From 0e43e0d7fce166ffe6629863c3964d8b1a765cb0 Mon Sep 17 00:00:00 2001 From: Andre Toerien Date: Wed, 25 Jun 2025 15:59:57 +0200 Subject: [PATCH] refactor(yarn): remove unnecessary Yarn::yarn field --- src/steps/node.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/steps/node.rs b/src/steps/node.rs index 9d89bf2d..046e18ca 100644 --- a/src/steps/node.rs +++ b/src/steps/node.rs @@ -117,15 +117,11 @@ impl NPM { struct Yarn { command: PathBuf, - yarn: Option, } impl Yarn { fn new(command: PathBuf) -> Self { - Self { - command, - yarn: require("yarn").ok(), - } + Self { command } } fn has_global_subcmd(&self) -> bool { @@ -153,8 +149,7 @@ impl Yarn { if use_sudo { let sudo = ctx.require_sudo()?; - let command = self.yarn.as_ref().unwrap_or(&self.command); - sudo.execute(ctx, command)?.args(args).status_checked()?; + sudo.execute(ctx, &self.command)?.args(args).status_checked()?; } else { ctx.execute(&self.command).args(args).status_checked()?; }