Skip to content

Commit 9f7bf68

Browse files
committed
make clippy happy
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent a0cf29f commit 9f7bf68

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/hyperlight_common/src/flatbuffer_wrappers/guest_trace_data.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ impl<T: Fn(&[u8])> EventsEncoder for EventsBatchEncoderGeneric<T> {
186186
// - If the estimate is too low, the FlatBuffer builder reallocates as needed.
187187
let estimated_size = estimate_event(event);
188188
let serialized = Vec::with_capacity(estimated_size);
189+
#[allow(clippy::unwrap_used)]
189190
let serialized = encode_extend(event, serialized).unwrap();
190191

191192
// Check if adding this event would exceed capacity
@@ -222,6 +223,7 @@ impl<T: Fn(&[u8])> EventsEncoder for EventsBatchEncoderGeneric<T> {
222223
}
223224

224225
pub fn estimate_event(event: &GuestEvent) -> usize {
226+
#[allow(clippy::unwrap_used)]
225227
encoded_size(event).unwrap()
226228
}
227229

src/hyperlight_common/src/flatbuffer_wrappers/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::func::ReturnValue;
2424
/// Flatbuffer-encodes the given value
2525
pub fn get_flatbuffer_result<T: Into<ReturnValue>>(val: T) -> Vec<u8> {
2626
let result = FunctionCallResult::new(Ok(val.into()));
27+
#[allow(clippy::unwrap_used)]
2728
encode(&result).unwrap()
2829
}
2930

@@ -79,6 +80,7 @@ pub fn estimate_flatbuffer_capacity(function_name: &str, args: &[ParameterValue]
7980
crate::flatbuffer_wrappers::function_types::ReturnType::Void,
8081
);
8182

83+
#[allow(clippy::unwrap_used)]
8284
let estimated_capacity = encoded_size(&dummy).unwrap();
8385

8486
/*

src/hyperlight_guest/src/guest_handle/host_comm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ use hyperlight_common::flatbuffer_wrappers::function_types::{
2525
use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
2626
use hyperlight_common::flatbuffer_wrappers::guest_log_data::GuestLogData;
2727
use hyperlight_common::flatbuffer_wrappers::guest_log_level::LogLevel;
28-
use hyperlight_common::flatbuffer_wrappers::host_function_details::HostFunctionDetails;
2928
use hyperlight_common::flatbuffer_wrappers::util::{
30-
decode, encode, encode_extend, estimate_flatbuffer_capacity,
29+
encode, encode_extend, estimate_flatbuffer_capacity,
3130
};
3231
use hyperlight_common::outb::OutBAction;
3332
use tracing::instrument;

src/hyperlight_host/src/sandbox/initialized_multi_use.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ impl MultiUseSandbox {
734734
);
735735

736736
let buffer = Vec::with_capacity(estimated_capacity);
737+
#[allow(clippy::unwrap_used)]
737738
let buffer = encode_extend(&fc, buffer).unwrap();
738739

739740
self.mem_mgr.write_guest_function_call(&buffer)?;

0 commit comments

Comments
 (0)