mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-21 07:42:05 +00:00
Add convenience methods to Manifest
to iterate over requirements (#2701)
## Summary These are repeated a bunch. It's nice to DRY them up and ensure the ordering is consistent.
This commit is contained in:
parent
b6ab919945
commit
4cc91cc6bb
7 changed files with 168 additions and 92 deletions
|
@ -136,10 +136,10 @@ impl VersionMap {
|
|||
/// stored in this map. For example, the versions `1.2.0` and `1.2` are
|
||||
/// semantically equivalent, but when converted to strings, they are
|
||||
/// distinct.
|
||||
pub(crate) fn get_with_version<'a>(
|
||||
&'a self,
|
||||
pub(crate) fn get_with_version(
|
||||
&self,
|
||||
version: &Version,
|
||||
) -> Option<(&'a Version, &'a PrioritizedDist)> {
|
||||
) -> Option<(&Version, &PrioritizedDist)> {
|
||||
match self.inner {
|
||||
VersionMapInner::Eager(ref map) => map.get_key_value(version),
|
||||
VersionMapInner::Lazy(ref lazy) => lazy.get_with_version(version),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue