Skip to content

Commit

Permalink
Update tame-index (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Aug 21, 2023
1 parent 591eaf8 commit 0a64912
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cargo_metadata = "0.17"
# Used to parse and evaluate cfg() expressions for dependencies
cfg-expr = "0.15"
# Allows inspection of the cargo registry index(ices)
tame-index = { version = "0.2", optional = true, default-features = false }
tame-index = { version = "0.4", optional = true, default-features = false }
# Used to create and traverse graph structures
petgraph = "0.6"
# Used for checking version requirements
Expand Down
17 changes: 10 additions & 7 deletions src/builder/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ impl CachingIndex {
let versions = krate
.versions
.into_iter()
.map(|kv| {
.filter_map(|kv| {
// The index (currently) can have both features, and
// features2, the features method gives us an iterator
// over both
let features = kv.features().map(|(k, v)| (k.clone(), v.clone())).collect();

IndexKrateVersion {
version: kv.version,
features,
}
kv.version.parse::<semver::Version>().ok().map(|version| {
IndexKrateVersion {
version,
features: kv
.features()
.map(|(k, v)| (k.clone(), v.clone()))
.collect(),
}
})
})
.collect();

Expand Down

0 comments on commit 0a64912

Please sign in to comment.