address nits

This commit is contained in:
Oliver Schneider 2017-01-31 08:08:54 +01:00
parent aebdf74e16
commit d9ec55e695
2 changed files with 7 additions and 6 deletions

View file

@ -491,6 +491,7 @@ pub fn overlapping<T>(ranges: &[SpannedRange<T>]) -> Option<(&SpannedRange<T>, &
match (self.value(), other.value()) {
(Bound::Included(a), Bound::Included(b)) |
(Bound::Excluded(a), Bound::Excluded(b)) => a.cmp(&b),
// Range patterns cannot be unbounded (yet)
(Bound::Unbounded, _) |
(_, Bound::Unbounded) => unimplemented!(),
(Bound::Included(a), Bound::Excluded(b)) => {

View file

@ -229,14 +229,14 @@ fn overlapping() {
match 42 {
0 ... 10 => println!("0 ... 10"), //~ERROR: some ranges overlap
0 ... 11 => println!("0 ... 10"), //~NOTE overlaps with this
0 ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
_ => (),
}
match 42 {
0 ... 5 => println!("0 ... 5"), //~ERROR: some ranges overlap
6 ... 7 => println!("6 ... 7"),
FOO ... 11 => println!("0 ... 10"), //~NOTE overlaps with this
FOO ... 11 => println!("0 ... 11"), //~NOTE overlaps with this
_ => (),
}
@ -248,13 +248,13 @@ fn overlapping() {
match 42 {
2 => println!("2"), //~NOTE overlaps with this
0 ... 2 => println!("0 ... 5"), //~ERROR: some ranges overlap
0 ... 2 => println!("0 ... 2"), //~ERROR: some ranges overlap
_ => (),
}
match 42 {
0 ... 10 => println!("0 ... 10"),
11 ... 50 => println!("0 ... 10"),
11 ... 50 => println!("11 ... 50"),
_ => (),
}
@ -265,8 +265,8 @@ fn overlapping() {
}
match 42 {
0 .. 10 => println!("0 ... 10"),
10 .. 50 => println!("0 ... 10"),
0 .. 10 => println!("0 .. 10"),
10 .. 50 => println!("10 .. 50"),
_ => (),
}