File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/hyperlight_host/src/sandbox Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 112
112
113
113
/// A `GuestBinary` is either a buffer containing the binary or a path to the binary
114
114
#[ derive( Debug ) ]
115
- pub enum GuestBinary {
115
+ pub enum GuestBinary < ' a > {
116
116
/// A buffer containing the guest binary
117
- Buffer ( Vec < u8 > ) ,
117
+ Buffer ( & ' a [ u8 ] ) ,
118
118
/// A path to the guest binary
119
119
FilePath ( String ) ,
120
120
}
@@ -372,15 +372,15 @@ mod tests {
372
372
373
373
let binary_path = simple_guest_as_string ( ) . unwrap ( ) ;
374
374
let sandbox =
375
- UninitializedSandbox :: new ( GuestBinary :: Buffer ( fs:: read ( binary_path) . unwrap ( ) ) , None ) ;
375
+ UninitializedSandbox :: new ( GuestBinary :: Buffer ( & fs:: read ( binary_path) . unwrap ( ) ) , None ) ;
376
376
assert ! ( sandbox. is_ok( ) ) ;
377
377
378
378
// Test with a invalid guest binary buffer
379
379
380
380
let binary_path = simple_guest_as_string ( ) . unwrap ( ) ;
381
381
let mut bytes = fs:: read ( binary_path) . unwrap ( ) ;
382
382
let _ = bytes. split_off ( 100 ) ;
383
- let sandbox = UninitializedSandbox :: new ( GuestBinary :: Buffer ( bytes) , None ) ;
383
+ let sandbox = UninitializedSandbox :: new ( GuestBinary :: Buffer ( & bytes) , None ) ;
384
384
assert ! ( sandbox. is_err( ) ) ;
385
385
}
386
386
You can’t perform that action at this time.
0 commit comments