mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 10:33:49 +00:00
Replace unreachable todo!()
with unreachable!()
in locking (#5857)
Replace a `todo!()` that was unreachable with an `unreachable!()` and a proper comment.
This commit is contained in:
parent
68f186c409
commit
54989f1376
1 changed files with 6 additions and 9 deletions
|
@ -1385,9 +1385,8 @@ enum Source {
|
|||
impl Source {
|
||||
fn from_resolved_dist(resolved_dist: &ResolvedDist) -> Source {
|
||||
match *resolved_dist {
|
||||
// TODO: Do we want to try to lock already-installed distributions?
|
||||
// Or should we return an error?
|
||||
ResolvedDist::Installed(_) => todo!(),
|
||||
// We pass empty installed packages for locking.
|
||||
ResolvedDist::Installed(_) => unreachable!(),
|
||||
ResolvedDist::Installable(ref dist) => Source::from_dist(dist),
|
||||
}
|
||||
}
|
||||
|
@ -1766,9 +1765,8 @@ impl SourceDist {
|
|||
annotated_dist: &AnnotatedDist,
|
||||
) -> Result<Option<SourceDist>, LockError> {
|
||||
match annotated_dist.dist {
|
||||
// TODO: Do we want to try to lock already-installed distributions?
|
||||
// Or should we return an error?
|
||||
ResolvedDist::Installed(_) => todo!(),
|
||||
// We pass empty installed packages for locking.
|
||||
ResolvedDist::Installed(_) => unreachable!(),
|
||||
ResolvedDist::Installable(ref dist) => {
|
||||
SourceDist::from_dist(id, dist, &annotated_dist.hashes)
|
||||
}
|
||||
|
@ -2007,9 +2005,8 @@ struct Wheel {
|
|||
impl Wheel {
|
||||
fn from_annotated_dist(annotated_dist: &AnnotatedDist) -> Result<Vec<Wheel>, LockError> {
|
||||
match annotated_dist.dist {
|
||||
// TODO: Do we want to try to lock already-installed distributions?
|
||||
// Or should we return an error?
|
||||
ResolvedDist::Installed(_) => todo!(),
|
||||
// We pass empty installed packages for locking.
|
||||
ResolvedDist::Installed(_) => unreachable!(),
|
||||
ResolvedDist::Installable(ref dist) => Wheel::from_dist(dist, &annotated_dist.hashes),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue