Skip to content

Commit 45be8bf

Browse files
committed
Use PEP440 style for range formatting
1 parent 4045e11 commit 45be8bf

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
@@ -1085,7 +1085,7 @@ impl<V: Display + Eq> Display for Ranges<V> {
10851085
(Included(v), Unbounded) => write!(f, ">={v}")?,
10861086
(Included(v), Included(b)) => {
10871087
if v == b {
1088-
write!(f, "{v}")?
1088+
write!(f, "=={v}")?
10891089
} else {
10901090
write!(f, ">={v}, <={b}")?
10911091
}

0 commit comments

Comments
 (0)