@@ -31,7 +31,7 @@ use std::{
31
31
32
32
use anyhow:: Context ;
33
33
34
- use tempfile:: { tempfile , NamedTempFile } ;
34
+ use tempfile:: NamedTempFile ;
35
35
36
36
pub use bootloader_boot_config:: BootConfig ;
37
37
@@ -71,7 +71,7 @@ impl DiskImageBuilder {
71
71
72
72
/// Add or replace a ramdisk to be included in the final image.
73
73
pub fn set_ramdisk ( & mut self , path : & Path ) -> & mut Self {
74
- self . add_or_replace_file ( & path, RAMDISK_FILE_NAME )
74
+ self . add_or_replace_file ( path, RAMDISK_FILE_NAME )
75
75
}
76
76
77
77
/// Configures the runtime behavior of the bootloader.
@@ -106,7 +106,7 @@ impl DiskImageBuilder {
106
106
self . files . insert (
107
107
0 ,
108
108
DiskImageFile {
109
- source : path. clone ( ) . to_path_buf ( ) ,
109
+ source : path. to_path_buf ( ) ,
110
110
destination : target. to_string ( ) ,
111
111
} ,
112
112
) ;
@@ -123,7 +123,7 @@ impl DiskImageBuilder {
123
123
}
124
124
125
125
for f in self . files . as_slice ( ) {
126
- local_map. insert ( & f. destination , & f. source . as_path ( ) ) ;
126
+ local_map. insert ( & f. destination , f. source . as_path ( ) ) ;
127
127
}
128
128
129
129
let out_file = NamedTempFile :: new ( ) . context ( "failed to create temp file" ) ?;
@@ -200,10 +200,7 @@ impl DiskImageBuilder {
200
200
201
201
for f in self . files . as_slice ( ) {
202
202
let to = tftp_path. join ( f. destination . clone ( ) ) ;
203
- let result = std:: fs:: copy ( f. source . clone ( ) , to) ;
204
- if result. is_err ( ) {
205
- return Err ( anyhow:: Error :: from ( result. unwrap_err ( ) ) ) ;
206
- }
203
+ std:: fs:: copy ( f. source . clone ( ) , to) ?;
207
204
}
208
205
209
206
Ok ( ( ) )
0 commit comments