Skip to content

Commit cf99526

Browse files
committed
Update to latest master - Ordering, Index.
- Use and namespace cmp::Ordering; - Use ops::Index.
1 parent 0cedc7a commit cf99526

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
use nfa::NFA;
44
use nfa::CharacterClass;
55
use std::collections::BTreeMap;
6+
use std::cmp::Ordering;
7+
use std::ops::Index;
68

79
pub mod nfa;
810

@@ -23,19 +25,19 @@ impl Metadata {
2325
impl Ord for Metadata {
2426
fn cmp(&self, other: &Metadata) -> Ordering {
2527
if self.stars > other.stars {
26-
Less
28+
Ordering::Less
2729
} else if self.stars < other.stars {
28-
Greater
30+
Ordering::Greater
2931
} else if self.dynamics > other.dynamics {
30-
Less
32+
Ordering::Less
3133
} else if self.dynamics < other.dynamics {
32-
Greater
34+
Ordering::Greater
3335
} else if self.statics > other.statics {
34-
Less
36+
Ordering::Less
3537
} else if self.statics < other.statics {
36-
Greater
38+
Ordering::Greater
3739
} else {
38-
Equal
40+
Ordering::Equal
3941
}
4042
}
4143
}

0 commit comments

Comments
 (0)