Skip to content

Commit

Permalink
--amend
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmarkmartin committed Nov 4, 2024
1 parent 1d16cb4 commit 8cece1c
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions crates/uv-pep440/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,17 +725,7 @@ impl std::fmt::Display for Version {
let local = if self.local().is_empty() {
String::new()
} else {
format!(
"+{}",
match self.local() {
LocalVersionSlice::Actual(segments) => segments
.iter()
.map(ToString::to_string)
.collect::<Vec<String>>()
.join("."),
LocalVersionSlice::Sentinel => String::from("<max-local-version>"),
}
)
format!("+{}", self.local().local_identifier_string())
};
write!(f, "{epoch}{release}{pre}{post}{dev}{local}")
}
Expand Down Expand Up @@ -1440,15 +1430,15 @@ impl LocalVersion {
}

impl LocalVersionSlice<'_> {
/// output the local version identifier string. [`LocalVersionSlice::Sentinel`] maps to `"<max-local-version>"` which is otherwise an illegal local version because `<` and `>` are not allowed
/// output the local version identifier string. [`LocalVersionSlice::Sentinel`] maps to `"[max-local-version]"` which is otherwise an illegal local version because `<` and `>` are not allowed
pub fn local_identifier_string(&self) -> String {
match self {
LocalVersionSlice::Actual(segments) => segments
.iter()
.map(ToString::to_string)
.collect::<Vec<String>>()
.join("."),
LocalVersionSlice::Sentinel => String::from("<max-local-version>"),
LocalVersionSlice::Sentinel => String::from("[max-local-version]"),
}
}
}
Expand Down

0 comments on commit 8cece1c

Please sign in to comment.