Use .expect() for extracting the current_dir.

This commit is contained in:
Arnavion 2016-10-23 12:29:33 -07:00
parent 2315a817ce
commit 604694bc0b

View file

@ -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");