Skip to content

Commit 2bc0f45

Browse files
committed
fix(builder): Make ValueRange display independent of usize::MAX
1 parent a0187c6 commit 2bc0f45

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clap_builder/src/builder/range.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ impl From<std::ops::RangeToInclusive<usize>> for ValueRange {
176176
impl std::fmt::Display for ValueRange {
177177
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
178178
ok!(self.start_inclusive.fmt(f));
179-
if !self.is_fixed() {
179+
if self.is_fixed() {
180+
} else if self.end_inclusive == usize::MAX {
181+
ok!("..".fmt(f));
182+
} else {
180183
ok!("..=".fmt(f));
181184
ok!(self.end_inclusive.fmt(f));
182185
}

0 commit comments

Comments
 (0)