mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 02:11:54 +00:00
explicitly return optionmodel for maps
This commit is contained in:
committed by
Aiden McClelland
parent
b7c8ee67bd
commit
a0d9392f77
@@ -242,13 +242,12 @@ impl<T: HasModel + Serialize + for<'de> Deserialize<'de>> OptionModel<T> {
|
|||||||
|
|
||||||
pub fn map<
|
pub fn map<
|
||||||
F: FnOnce(T::Model) -> V,
|
F: FnOnce(T::Model) -> V,
|
||||||
U: Serialize + for<'de> Deserialize<'de>,
|
U: Serialize + for<'de> Deserialize<'de> + HasModel,
|
||||||
V: ModelFor<U>,
|
V: ModelFor<U>,
|
||||||
W: ModelFor<Option<U>>,
|
|
||||||
>(
|
>(
|
||||||
self,
|
self,
|
||||||
f: F,
|
f: F,
|
||||||
) -> W {
|
) -> OptionModel<U> {
|
||||||
Into::<JsonPointer>::into(f(self.0)).into()
|
Into::<JsonPointer>::into(f(self.0)).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user