Skip to content

Commit 933ba6e

Browse files
committed
refactor(registry): Reduce places we list all IndexSummary variants
1 parent ac9c4e3 commit 933ba6e

File tree

1 file changed

+1
-6
lines changed
  • src/cargo/sources/registry/index

1 file changed

+1
-6
lines changed

src/cargo/sources/registry/index/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,7 @@ impl IndexSummary {
169169

170170
/// Extract the package id from any variant
171171
pub fn package_id(&self) -> PackageId {
172-
match self {
173-
IndexSummary::Candidate(sum)
174-
| IndexSummary::Yanked(sum)
175-
| IndexSummary::Offline(sum)
176-
| IndexSummary::Unsupported(sum, _) => sum.package_id(),
177-
}
172+
self.as_summary().package_id()
178173
}
179174

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

0 commit comments

Comments
 (0)