Upgrade to latest rust

This commit is contained in:
Greg M
2014-07-01 10:36:57 -04:00
parent abf5a2abe6
commit 067e0e89ef
2 changed files with 20 additions and 10 deletions
+10 -5
View File
@@ -8,13 +8,18 @@ struct Key {
}
impl PartialOrd for Key {
fn lt (&self, other: &Key) -> bool {
if self.code < other.code {
true
} else {
false
fn partial_cmp(&self, other: &Key) -> Option<Ordering> {
match (!self.lt(other), !other.lt(self)) {
(false, false) => None,
(false, true) => Some(Less),
(true, false) => Some(Greater),
(true, true) => Some(Equal),
}
}
fn lt (&self, other: &Key) -> bool {
self.code < other.code
}
}
impl PartialEq for Key {
+10 -5
View File
@@ -8,13 +8,18 @@ struct ScanCode {
}
impl PartialOrd for ScanCode {
fn lt (&self, other: &ScanCode) -> bool {
if self.code < other.code {
true
} else {
false
fn partial_cmp(&self, other: &ScanCode) -> Option<Ordering> {
match (!self.lt(other), !other.lt(self)) {
(false, false) => None,
(false, true) => Some(Less),
(true, false) => Some(Greater),
(true, true) => Some(Equal),
}
}
fn lt (&self, other: &ScanCode) -> bool {
self.code < other.code
}
}
impl PartialEq for ScanCode {