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 112112
113113/// A `GuestBinary` is either a buffer containing the binary or a path to the binary
114114#[ derive( Debug ) ]
115- pub enum GuestBinary {
115+ pub enum GuestBinary < ' a > {
116116 /// A buffer containing the guest binary
117- Buffer ( Vec < u8 > ) ,
117+ Buffer ( & ' a [ u8 ] ) ,
118118 /// A path to the guest binary
119119 FilePath ( String ) ,
120120}
@@ -372,15 +372,15 @@ mod tests {
372372
373373 let binary_path = simple_guest_as_string ( ) . unwrap ( ) ;
374374 let sandbox =
375- UninitializedSandbox :: new ( GuestBinary :: Buffer ( fs:: read ( binary_path) . unwrap ( ) ) , None ) ;
375+ UninitializedSandbox :: new ( GuestBinary :: Buffer ( & fs:: read ( binary_path) . unwrap ( ) ) , None ) ;
376376 assert ! ( sandbox. is_ok( ) ) ;
377377
378378 // Test with a invalid guest binary buffer
379379
380380 let binary_path = simple_guest_as_string ( ) . unwrap ( ) ;
381381 let mut bytes = fs:: read ( binary_path) . unwrap ( ) ;
382382 let _ = bytes. split_off ( 100 ) ;
383- let sandbox = UninitializedSandbox :: new ( GuestBinary :: Buffer ( bytes) , None ) ;
383+ let sandbox = UninitializedSandbox :: new ( GuestBinary :: Buffer ( & bytes) , None ) ;
384384 assert ! ( sandbox. is_err( ) ) ;
385385 }
386386
You can’t perform that action at this time.
0 commit comments