mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Use .expect() for extracting the current_dir.
This commit is contained in:
parent
2315a817ce
commit
604694bc0b
1 changed files with 2 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue