From c9d26540bfb0411f08e471c16a6badd71fea4cf2 Mon Sep 17 00:00:00 2001 From: honeywest Date: Mon, 11 Jan 2021 19:16:32 +0800 Subject: [PATCH] feat expect warning --- src/workspace/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/workspace/mod.rs b/src/workspace/mod.rs index 9bd8af5e..b1686163 100644 --- a/src/workspace/mod.rs +++ b/src/workspace/mod.rs @@ -52,10 +52,12 @@ impl Workspace { .packages .iter() .find(|p| p.id == *package_id) - .expect(&format!( - "Package '{}' is a member and should be in the packages list", - package_id - )); + .unwrap_or_else(|| { + panic!( + "Package '{}' is a member and should be in the packages list", + package_id + ) + }); let manifest = Manifest::new(&package.manifest_path)?; Ok((package_id.clone(), (package.clone(), manifest))) }; -- GitLab