This commit is contained in:
Chris Tsang 2022-11-28 13:04:25 +08:00
parent f3910c329b
commit 1b4e1670f7

View File

@ -81,11 +81,7 @@ where
let result: Vec<Option<<R as EntityTrait>::Model>> = keys
.iter()
.map(|key| {
hashmap
.get(&format!("{:?}", key))
.and_then(|val| Some(val.clone()))
})
.map(|key| hashmap.get(&format!("{:?}", key)).cloned())
.collect();
Ok(result)
@ -143,8 +139,8 @@ where
.map(|key: &ValueTuple| {
hashmap
.get(&format!("{:?}", key))
.and_then(|val| Some(val.clone()))
.unwrap_or_else(|| vec![])
.cloned()
.unwrap_or_default()
})
.collect();