Skip to content

Commit

Permalink
refactor(registry): Reduce places we list all IndexSummary variants
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Dec 12, 2024
1 parent 7dfa046 commit dcc0d20
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/cargo/sources/registry/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,7 @@ impl IndexSummary {

/// Extract the package id from any variant
pub fn package_id(&self) -> PackageId {
match self {
IndexSummary::Candidate(sum)
| IndexSummary::Yanked(sum)
| IndexSummary::Offline(sum)
| IndexSummary::Unsupported(sum, _) => sum.package_id(),
}
self.as_summary().package_id()
}

/// Returns `true` if the index summary is [`Yanked`].
Expand Down

0 comments on commit dcc0d20

Please sign in to comment.