From b213b9a684fa9e356488b27c050f1c3f37c4d6fd Mon Sep 17 00:00:00 2001 From: Christian Krause Date: Fri, 20 Oct 2023 09:42:54 +0200 Subject: [PATCH] fixes clippy::missing_panics_doc ... indirectly by using let-else instead of expect --- src/analysis/spectrum_scale.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/analysis/spectrum_scale.rs b/src/analysis/spectrum_scale.rs index eea2d14..b7c22e8 100644 --- a/src/analysis/spectrum_scale.rs +++ b/src/analysis/spectrum_scale.rs @@ -62,14 +62,17 @@ pub fn run( log::debug!("command: {command:?}"); - let mut child = command - .stdout(Stdio::null()) - .spawn() - .expect("mmapplypolicy failed to start, make sure it's on your PATH"); + let Ok(mut child) = command.stdout(Stdio::null()).spawn() else { + return Err(anyhow!( + "mmapplypolicy failed to start, make sure it's on your PATH", + )); + }; log::debug!("waiting for mmapplypolicy to finish"); - let ecode = child.wait().expect("failed waiting on mmapplypolicy"); + let Ok(ecode) = child.wait() else { + return Err(anyhow!("failed waiting on mmapplypolicy")); + }; if ecode.success() { let total_file = tmp.path().join("stor-age.list.total");