Skip to content

Commit fa7a75d

Browse files
committed
Use PEP440 style for range formatting
1 parent b70a960 commit fa7a75d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/examples.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ fn confusing_with_lots_of_holes() {
237237
};
238238
assert_eq!(
239239
&DefaultStringReporter::report(&derivation_tree),
240-
r#"Because there is no available version for bar and foo 1 | 2 | 3 | 4 | 5 depends on bar, foo 1 | 2 | 3 | 4 | 5 is forbidden.
241-
And because there is no version of foo in <1 | >1, <2 | >2, <3 | >3, <4 | >4, <5 | >5 and root 1 depends on foo, root 1 is forbidden."#
240+
r#"Because there is no available version for bar and foo ==1 | ==2 | ==3 | ==4 | ==5 depends on bar, foo ==1 | ==2 | ==3 | ==4 | ==5 is forbidden.
241+
And because there is no version of foo in <1 | >1, <2 | >2, <3 | >3, <4 | >4, <5 | >5 and root ==1 depends on foo, root ==1 is forbidden."#
242242
);
243243
derivation_tree.collapse_no_versions();
244244
assert_eq!(
245245
&DefaultStringReporter::report(&derivation_tree),
246-
"Because foo depends on bar and root 1 depends on foo, root 1 is forbidden."
246+
"Because foo depends on bar and root ==1 depends on foo, root ==1 is forbidden."
247247
);
248248
assert_eq!(
249249
derivation_tree.packages(),

version-ranges/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ impl<V: Display + Eq> Display for Ranges<V> {
10771077
(Included(v), Unbounded) => write!(f, ">={v}")?,
10781078
(Included(v), Included(b)) => {
10791079
if v == b {
1080-
write!(f, "{v}")?
1080+
write!(f, "=={v}")?
10811081
} else {
10821082
write!(f, ">={v}, <={b}")?
10831083
}

0 commit comments

Comments
 (0)