Merge pull request #145 from gmorenz/update-rust

Upgrade to latest rust
This commit is contained in:
Tony Aldridge
2014-07-02 11:36:18 +01:00
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 {