mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Merge pull request #145 from gmorenz/update-rust
Upgrade to latest rust
This commit is contained in:
+10
-5
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user