Skip to content

Commit

Permalink
fix(builder): Make ValueRange display independent of usize::MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Feb 14, 2025
1 parent a0187c6 commit 2bc0f45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clap_builder/src/builder/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ impl From<std::ops::RangeToInclusive<usize>> for ValueRange {
impl std::fmt::Display for ValueRange {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
ok!(self.start_inclusive.fmt(f));
if !self.is_fixed() {
if self.is_fixed() {
} else if self.end_inclusive == usize::MAX {
ok!("..".fmt(f));
} else {
ok!("..=".fmt(f));
ok!(self.end_inclusive.fmt(f));
}
Expand Down

0 comments on commit 2bc0f45

Please sign in to comment.