File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,26 +45,27 @@ impl<'a> DiskImageBuilder<'a> {
4545 Self { files : Vec :: new ( ) }
4646 }
4747 /// Add or replace a ramdisk to be included in the final image.
48- pub fn set_ramdisk ( & mut self , path : & ' a PathBuf ) {
49- self . add_or_replace_file ( path, RAMDISK_FILE_NAME ) ;
48+ pub fn set_ramdisk ( & mut self , path : & ' a PathBuf ) -> & mut Self {
49+ self . add_or_replace_file ( path, RAMDISK_FILE_NAME )
5050 }
5151
5252 /// Add or replace a kernel to be included in the final image.
53- pub fn set_kernel ( & mut self , path : & ' a PathBuf ) {
53+ pub fn set_kernel ( & mut self , path : & ' a PathBuf ) -> & mut Self {
5454 self . add_or_replace_file ( path, KERNEL_FILE_NAME )
5555 }
5656
5757 /// Add or replace arbitrary files.
5858 /// NOTE: You can overwrite internal files if you choose, such as EFI/BOOT/BOOTX64.EFI
5959 /// This can be useful in situations where you want to generate an image, but not use the provided bootloader.
60- pub fn add_or_replace_file ( & mut self , path : & ' a PathBuf , target : & ' a str ) {
60+ pub fn add_or_replace_file ( & mut self , path : & ' a PathBuf , target : & ' a str ) -> & mut Self {
6161 self . files . insert (
6262 0 ,
6363 DiskImageFile :: < ' a > {
6464 source : & path,
6565 destination : & target,
6666 } ,
6767 ) ;
68+ self
6869 }
6970 fn create_fat_filesystem_image (
7071 & self ,
You can’t perform that action at this time.
0 commit comments