Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tame-index #57

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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