We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 992ae8f commit f84d827Copy full SHA for f84d827
crates/value/src/lib.rs
@@ -251,6 +251,17 @@ impl TryFrom<String> for ConvexValue {
251
}
252
253
254
+impl<T: TryInto<ConvexValue, Error = anyhow::Error>> TryFrom<Option<T>> for ConvexValue {
255
+ type Error = anyhow::Error;
256
+
257
+ fn try_from(v: Option<T>) -> anyhow::Result<Self> {
258
+ Ok(match v {
259
+ None => ConvexValue::Null,
260
+ Some(v) => v.try_into()?,
261
+ })
262
+ }
263
+}
264
265
impl<'a> TryFrom<&'a str> for ConvexValue {
266
type Error = anyhow::Error;
267
0 commit comments