diff --git a/src/workspace/mod.rs b/src/workspace/mod.rs index 9bd8af5e66c7545548fd4df63774ddcbdaa5ec69..b1686163f4f478309cf7715837aaff798f7dee47 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))) };