From 604694bc0b2f445520469d62ecf54d60f3cc39db Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sun, 23 Oct 2016 12:29:33 -0700 Subject: [PATCH] Use .expect() for extracting the current_dir. --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c008dae2fe85..0eef99bfc12b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,11 +152,10 @@ pub fn main() { let package_manifest_path = Path::new(&package.manifest_path); if let Some(ref manifest_path) = manifest_path { package_manifest_path == manifest_path - } else if let Ok(ref current_dir) = current_dir { + } else { + let current_dir = current_dir.as_ref().expect("could not read current directory"); let package_manifest_directory = package_manifest_path.parent().expect("could not find parent directory of package manifest"); package_manifest_directory == current_dir - } else { - panic!("could not read current directory") } }) .expect("could not find matching package");