File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ pub use bios::BiosBoot;
2424mod fat;
2525mod file_data_source;
2626
27- use std:: { collections:: BTreeMap , fs, path:: Path } ;
27+ use std:: {
28+ collections:: BTreeMap ,
29+ fs,
30+ path:: { Path , PathBuf } ,
31+ } ;
2832
2933use anyhow:: Context ;
3034
@@ -85,13 +89,13 @@ impl DiskImageBuilder {
8589 }
8690
8791 /// Add a file with the specified bytes to the disk image
88- pub fn set_file_contents ( & mut self , destination : & str , data : & [ u8 ] ) -> & mut Self {
89- self . set_file_source ( destination, FileDataSource :: Data ( data. to_vec ( ) ) )
92+ pub fn set_file_contents ( & mut self , destination : & str , data : Vec < u8 > ) -> & mut Self {
93+ self . set_file_source ( destination, FileDataSource :: Data ( data) )
9094 }
9195
9296 /// Add a file with the specified source file to the disk image
93- pub fn set_file ( & mut self , destination : & str , file_path : & Path ) -> & mut Self {
94- self . set_file_source ( destination, FileDataSource :: File ( file_path. to_path_buf ( ) ) )
97+ pub fn set_file ( & mut self , destination : & str , file_path : PathBuf ) -> & mut Self {
98+ self . set_file_source ( destination, FileDataSource :: File ( file_path) )
9599 }
96100
97101 fn create_fat_filesystem_image (
You can’t perform that action at this time.
0 commit comments