From 3426138e75e300ff0cc6ef91aa9c95ab49b677af Mon Sep 17 00:00:00 2001 From: Niklas Sombert Date: Fri, 14 Jun 2024 11:24:29 +0200 Subject: [PATCH] Fix some warnings --- towboot/src/main.rs | 1 - towbootctl/src/image.rs | 1 + towbootctl/src/lib.rs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/towboot/src/main.rs b/towboot/src/main.rs index f7db4f1..8ee470e 100644 --- a/towboot/src/main.rs +++ b/towboot/src/main.rs @@ -118,7 +118,6 @@ fn efi_main(image: Handle, mut systab: SystemTable) -> Status { Ok(e) => { info!("booting {entry_to_boot}..."); e.boot(systab); - unreachable!(); }, Err(e) => { error!("failed to prepare the entry: {e:?}"); diff --git a/towbootctl/src/image.rs b/towbootctl/src/image.rs index 0499497..275213a 100644 --- a/towbootctl/src/image.rs +++ b/towbootctl/src/image.rs @@ -20,6 +20,7 @@ impl Image { .read(true) .write(true) .create(true) + .truncate(true) .open(path)?); file.set_len(size)?; // protective MBR diff --git a/towbootctl/src/lib.rs b/towbootctl/src/lib.rs index 2a7e306..bef9485 100644 --- a/towbootctl/src/lib.rs +++ b/towbootctl/src/lib.rs @@ -42,7 +42,7 @@ fn get_config_files(config: &mut Config) -> Result> { paths.push((src_path, dst_path)); } - return Ok(paths); + Ok(paths) } /// Joins a slice of strings.