diff --git a/src/registry.rs b/src/registry.rs index cbf8016..5e6b16c 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -313,12 +313,9 @@ impl Registry { // Find and return the project that matches the current working directory, if any pub fn match_cwd(&self, deps: &impl WorkingDirectory) -> Result> { let cwd = deps.get_cwd()?; - Ok(self.iter_projects().find(|(_, project)| { - project - .directory - .as_ref() - .map_or(false, |directory| directory == &cwd) - })) + Ok(self + .iter_projects() + .find(|(_, project)| project.directory.as_ref() == Some(&cwd))) } // Normalize a potential project name by stripping out invalid characters