diff --git a/01.workspace/heave/src/str/entity.rs b/01.workspace/heave/src/str/entity.rs index 30e0ebf..e080a3c 100644 --- a/01.workspace/heave/src/str/entity.rs +++ b/01.workspace/heave/src/str/entity.rs @@ -64,6 +64,12 @@ impl O { .map(|value| T::from(value.clone())) .unwrap() } + pub fn unwrap_opt(&self, id: &str) -> Option + where + T: From, + { + self.value_of(id).map(|value| T::from(value.clone())) + } pub fn unwrap_or(&self, id: &str, default: T) -> T where T: From,