Skip to content

Commit

Permalink
Borrow xdg variable instead of cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Oct 25, 2024
1 parent 68906e5 commit bc1fd29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli/cmd/login/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl LoginSubcommand {

let xdg = xdg::BaseDirectories::new()?;

let netrc_path = get_netrc_path(xdg.clone()).await?;
let netrc_path = get_netrc_path(&xdg).await?;

// $XDG_CONFIG_HOME/nix/nix.conf; basically ~/.config/nix/nix.conf
let nix_config_path = xdg.place_config_file("nix/nix.conf")?;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ fn validate_segment(s: &str) -> Result<(), FhError> {

// See if the netrc exists at the /nix/var/determinate/netrc and, if not, try
// to find it via XDG path.
async fn get_netrc_path(xdg: BaseDirectories) -> Result<PathBuf, FhError> {
async fn get_netrc_path(xdg: &BaseDirectories) -> Result<PathBuf, FhError> {
match try_exists(DET_NIX_NETRC_PATH).await {
Ok(exists) if exists => Ok(PathBuf::from(DET_NIX_NETRC_PATH)),
_ => {
Expand Down

0 comments on commit bc1fd29

Please sign in to comment.