diff --git a/crates/volta-core/src/project/mod.rs b/crates/volta-core/src/project/mod.rs index 745739db0..1e9d7379b 100644 --- a/crates/volta-core/src/project/mod.rs +++ b/crates/volta-core/src/project/mod.rs @@ -174,7 +174,7 @@ impl Project { // (project uses Yarn berry if 'yarnrc.yml' exists, uses PnP if '.pnp.js' or '.pnp.cjs' exist) pub fn needs_yarn_run(&self) -> bool { self.platform() - .map_or(false, |platform| platform.yarn.is_some()) + .is_some_and(|platform| platform.yarn.is_some()) && self.workspace_roots().any(|x| { x.join(".yarnrc.yml").exists() || x.join(".pnp.cjs").exists() @@ -251,11 +251,11 @@ fn is_node_root(dir: &Path) -> bool { } fn is_node_modules(dir: &Path) -> bool { - dir.file_name().map_or(false, |tail| tail == "node_modules") + dir.file_name().is_some_and(|tail| tail == "node_modules") } fn is_dependency(dir: &Path) -> bool { - dir.parent().map_or(false, is_node_modules) + dir.parent().is_some_and(is_node_modules) } fn is_project_root(dir: &Path) -> bool { diff --git a/src/volta-migrate.rs b/src/volta-migrate.rs index 79b867797..7a0cd91c9 100644 --- a/src/volta-migrate.rs +++ b/src/volta-migrate.rs @@ -10,7 +10,7 @@ pub fn main() { // In order to migrate the existing Volta directory while avoiding unconditional changes to the user's system, // the Homebrew formula runs volta-migrate with `--no-create` flag in the post-install phase. let no_create = matches!(std::env::args_os().nth(1), Some(flag) if flag == "--no-create"); - if no_create && !volta_home().map_or(false, |home| home.root().exists()) { + if no_create && volta_home().map_or(true, |home| !home.root().exists()) { ExitCode::Success.exit(); }