From 3f2272aa94a4389d7fa3ddd6f39feb8843cbe4dc Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Tue, 23 Jan 2024 18:02:22 -0500 Subject: [PATCH] Fix a couple of clippy nits Signed-off-by: John Eckersberg --- lib/src/deploy.rs | 2 +- lib/src/install.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/src/deploy.rs b/lib/src/deploy.rs index 482359187..fd2913197 100644 --- a/lib/src/deploy.rs +++ b/lib/src/deploy.rs @@ -310,7 +310,7 @@ pub(crate) fn switch_origin_inplace(root: &Dir, imgref: &ImageReference) -> Resu deploydir .atomic_write(&origin_path, serialized_origin.as_bytes()) .context("Writing origin")?; - return Ok(newest_deployment); + Ok(newest_deployment) } #[test] diff --git a/lib/src/install.rs b/lib/src/install.rs index cb9416ca1..04e737ada 100644 --- a/lib/src/install.rs +++ b/lib/src/install.rs @@ -1099,10 +1099,8 @@ pub(crate) async fn install_to_disk(opts: InstallToDiskOpts) -> Result<()> { let loopback_dev = crate::blockdev::LoopbackDevice::new(block_opts.device.as_std_path())?; block_opts.device = loopback_dev.path().into(); loopback = Some(loopback_dev); - } else { - if !target_blockdev_meta.file_type().is_block_device() { - anyhow::bail!("Not a block device: {}", block_opts.device); - } + } else if !target_blockdev_meta.file_type().is_block_device() { + anyhow::bail!("Not a block device: {}", block_opts.device); } let state = prepare_install(opts.config_opts, opts.source_opts, opts.target_opts).await?;