Fixed some clippy linting issues

This commit is contained in:
Daniel García
2018-12-07 15:01:29 +01:00
parent cb930a0858
commit 738ad2127b
8 changed files with 26 additions and 36 deletions

View File

@@ -77,10 +77,10 @@ impl PartialEq<i32> for UserOrgType {
impl PartialOrd<i32> for UserOrgType {
fn partial_cmp(&self, other: &i32) -> Option<Ordering> {
if let Some(other) = Self::from_i32(other) {
if let Some(other) = Self::from_i32(*other) {
return Some(self.cmp(&other))
}
return None
None
}
fn gt(&self, other: &i32) -> bool {
@@ -107,10 +107,10 @@ impl PartialEq<UserOrgType> for i32 {
impl PartialOrd<UserOrgType> for i32 {
fn partial_cmp(&self, other: &UserOrgType) -> Option<Ordering> {
if let Some(self_type) = UserOrgType::from_i32(self) {
if let Some(self_type) = UserOrgType::from_i32(*self) {
return Some(self_type.cmp(other))
}
return None
None
}
fn lt(&self, other: &UserOrgType) -> bool {
@@ -140,7 +140,7 @@ impl UserOrgType {
}
}
pub fn from_i32(i: &i32) -> Option<Self> {
pub fn from_i32(i: i32) -> Option<Self> {
match i {
0 => Some(UserOrgType::Owner),
1 => Some(UserOrgType::Admin),