Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-29 06:20:29 +01:00
Set PartialOrd to consider invalid i32 UserOrgType lower than anything
Dieser Commit ist enthalten in:
Ursprung
b94f4db52a
Commit
f3e6cc6ffd
1 geänderte Dateien mit 30 neuen und 0 gelöschten Zeilen
|
@ -83,6 +83,21 @@ impl PartialOrd<i32> for UserOrgType {
|
||||||
}
|
}
|
||||||
return None
|
return None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn gt(&self, other: &i32) -> bool {
|
||||||
|
match self.partial_cmp(other) {
|
||||||
|
Some(Ordering::Less) => false,
|
||||||
|
_ => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn ge(&self, other: &i32) -> bool {
|
||||||
|
match self.partial_cmp(other) {
|
||||||
|
Some(Ordering::Less) => false,
|
||||||
|
_ => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartialEq<UserOrgType> for i32 {
|
impl PartialEq<UserOrgType> for i32 {
|
||||||
|
@ -98,6 +113,21 @@ impl PartialOrd<UserOrgType> for i32 {
|
||||||
}
|
}
|
||||||
return None
|
return None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn lt(&self, other: &UserOrgType) -> bool {
|
||||||
|
match self.partial_cmp(other) {
|
||||||
|
Some(Ordering::Less) | None => true,
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn le(&self, other: &UserOrgType) -> bool {
|
||||||
|
match self.partial_cmp(other) {
|
||||||
|
Some(Ordering::Less) | Some(Ordering::Equal) | None => true,
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UserOrgType {
|
impl UserOrgType {
|
||||||
|
|
Laden …
In neuem Issue referenzieren