Skip to content

Commit

Permalink
upgrade crates-index
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jul 31, 2023
1 parent c5fa27a commit c201f15
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 9 deletions.
53 changes: 47 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tracing-subscriber = { version = "0.3.16", default-features = false, features =
tracing-log = "0.1.3"
regex = "1"
clap = { version = "4.0.22", features = [ "derive" ] }
crates-index = { version = "1.0.0", optional = true }
crates-index = { version = "2.0.0", default-features = false, features = ["git", "git-performance", "parallel"], optional = true }
rayon = "1.6.1"
num_cpus = "1.15.0"
crates-index-diff = { version = "20.0.0", features = [ "max-performance" ]}
Expand Down
4 changes: 2 additions & 2 deletions src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ impl Index {
}

#[cfg(feature = "consistency_check")]
pub(crate) fn crates(&self) -> Result<crates_index::Index> {
pub(crate) fn crates(&self) -> Result<crates_index::GitIndex> {
tracing::debug!("Opening with `crates_index`");
// crates_index requires the repo url to match the existing origin or it tries to reinitialize the repo
let repo_url = self
.repository_url
.as_deref()
.unwrap_or("https://github.com/rust-lang/crates.io-index");
let mut index = crates_index::Index::with_path(&self.path, repo_url)?;
let mut index = crates_index::GitIndex::with_path(&self.path, repo_url)?;
index.update()?;
Ok(index)
}
Expand Down

0 comments on commit c201f15

Please sign in to comment.