Skip to content

Commit

Permalink
Fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
karatakis committed Oct 10, 2023
1 parent 5110ab7 commit 043b9fc
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/query/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ where
T: sea_orm::EntityTrait,
{
fn eq(&self, other: &Self) -> bool {
self.key.iter().map(map_key).eq(other.key.iter().map(map_key)) && self.meta.eq(&other.meta)
self.key
.iter()
.map(map_key)
.eq(other.key.iter().map(map_key))
&& self.meta.eq(&other.meta)
}
}

Expand All @@ -28,28 +32,28 @@ fn map_key(key: &sea_orm::Value) -> sea_orm::Value {
sea_orm::Value::TinyInt(value) => {
let value: Option<i64> = value.map(|value| value as i64);
sea_orm::Value::BigInt(value)
},
}
sea_orm::Value::SmallInt(value) => {
let value: Option<i64> = value.map(|value| value as i64);
sea_orm::Value::BigInt(value)
},
}
sea_orm::Value::Int(value) => {
let value: Option<i64> = value.map(|value| value as i64);
sea_orm::Value::BigInt(value)
},
}
sea_orm::Value::TinyUnsigned(value) => {
let value: Option<u64> = value.map(|value| value as u64);
sea_orm::Value::BigUnsigned(value)
},
}
sea_orm::Value::SmallUnsigned(value) => {
let value: Option<u64> = value.map(|value| value as u64);
sea_orm::Value::BigUnsigned(value)
},
}
sea_orm::Value::Unsigned(value) => {
let value: Option<u64> = value.map(|value| value as u64);
sea_orm::Value::BigUnsigned(value)
},
_ => key.clone()
}
_ => key.clone(),
}
}

Expand All @@ -65,28 +69,28 @@ where
sea_orm::Value::TinyInt(value) => {
let value: Option<i64> = value.map(|value| value as i64);
value.hash(state);
},
}
sea_orm::Value::SmallInt(value) => {
let value: Option<i64> = value.map(|value| value as i64);
value.hash(state);
},
}
sea_orm::Value::Int(value) => {
let value: Option<i64> = value.map(|value| value as i64);
value.hash(state);
},
}
sea_orm::Value::TinyUnsigned(value) => {
let value: Option<u64> = value.map(|value| value as u64);
value.hash(state);
},
}
sea_orm::Value::SmallUnsigned(value) => {
let value: Option<u64> = value.map(|value| value as u64);
value.hash(state);
},
}
sea_orm::Value::Unsigned(value) => {
let value: Option<u64> = value.map(|value| value as u64);
value.hash(state);
},
_ => key.hash(state)
}
_ => key.hash(state),
}
}
self.meta.hash(state);
Expand Down

0 comments on commit 043b9fc

Please sign in to comment.