Skip to content

Commit

Permalink
switch to home library for getting the cargo home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed Aug 29, 2024
1 parent 047da58 commit 820595a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ toml = "0.8"
derive_more = "0.99"
itertools = "0.12"
dirs = "5.0.1"
home = "0.5.9"
pretty_env_logger = "0.5.0"

[profile.release]
Expand Down
4 changes: 2 additions & 2 deletions src/backend/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ impl Backend for Cargo {
return Ok(BTreeMap::new());
}

let file = dirs::home_dir()
.context("getting the home directory")?
let file = home::cargo_home()
.context("getting the cargo home directory")?
.join(".crates2.json");

let contents = match std::fs::read_to_string(file) {
Expand Down

0 comments on commit 820595a

Please sign in to comment.