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;
24
24
mod fat;
25
25
mod file_data_source;
26
26
27
- use std:: { collections:: BTreeMap , fs, path:: Path } ;
27
+ use std:: {
28
+ collections:: BTreeMap ,
29
+ fs,
30
+ path:: { Path , PathBuf } ,
31
+ } ;
28
32
29
33
use anyhow:: Context ;
30
34
@@ -85,13 +89,13 @@ impl DiskImageBuilder {
85
89
}
86
90
87
91
/// 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) )
90
94
}
91
95
92
96
/// 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) )
95
99
}
96
100
97
101
fn create_fat_filesystem_image (
You can’t perform that action at this time.
0 commit comments