Skip to content

Commit

Permalink
Honor the bikeshed by converting public field to getter
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Apr 11, 2023
1 parent bb54d89 commit d131153
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crates/turborepo-lib/src/commands/mod.rs
Expand Up @@ -27,7 +27,7 @@ pub struct CommandBase {
user_config: OnceCell<UserConfig>,
repo_config: OnceCell<RepoConfig>,
client_config: OnceCell<ClientConfig>,
pub args: Args,
args: Args,
version: &'static str,
}

Expand Down Expand Up @@ -128,6 +128,10 @@ impl CommandBase {
Ok(self.client_config.get().unwrap())
}

pub fn args(&self) -> &Args {
&self.args
}

pub fn api_client(&mut self) -> Result<APIClient> {
let repo_config = self.repo_config()?;
let client_config = self.client_config()?;
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/execution_state.rs
Expand Up @@ -32,7 +32,7 @@ impl<'a> TryFrom<&'a CommandBase> for ExecutionState<'a> {

Ok(ExecutionState {
remote_config,
cli_args: &base.args,
cli_args: base.args(),
})

Check failure on line 36 in crates/turborepo-lib/src/execution_state.rs

View workflow job for this annotation

GitHub Actions / Rust linting

Diff in /home/runner/work/turbo/turbo/crates/turborepo-lib/src/execution_state.rs
}
}
Expand Down

0 comments on commit d131153

Please sign in to comment.