Skip to content

Commit

Permalink
Use into() instead of explicit conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Oct 25, 2024
1 parent 15697c7 commit 0d71125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/cli/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,12 @@ fn validate_segment(s: &str) -> Result<(), FhError> {
// to find it via XDG path.
async fn get_netrc_path(xdg: &BaseDirectories) -> Result<PathBuf, FhError> {
match try_exists(DETERMINATE_NIX_NETRC_PATH).await {
Ok(exists) if exists => Ok(PathBuf::from(DETERMINATE_NIX_NETRC_PATH)),
Ok(exists) if exists => Ok(DETERMINATE_NIX_NETRC_PATH.into()),
_ => {
let xdg_path = xdg.place_config_file(XDG_NIX_NETRC_SUFFIX)?;

match try_exists(&xdg_path).await {
Ok(exists) if exists => Ok(xdg_path.to_path_buf()),
Ok(exists) if exists => Ok(xdg_path.into()),
_ => Err(FhError::NetrcNotFound(xdg_path.display().to_string())),
}
}
Expand Down

0 comments on commit 0d71125

Please sign in to comment.