diff --git a/src/curr/scval_conversions.rs b/src/curr/scval_conversions.rs index 01f48286..0856ab81 100644 --- a/src/curr/scval_conversions.rs +++ b/src/curr/scval_conversions.rs @@ -559,6 +559,18 @@ impl> From> for ScVal { } } +impl From<&Option> for ScVal +where + for<'a> &'a T: Into, +{ + fn from(v: &Option) -> Self { + match v { + Some(v) => v.into(), + None => ().into(), + } + } +} + macro_rules! impl_for_tuple { ( $count:literal $($typ:ident $idx:tt)+ ) => { #[cfg(feature = "alloc")] diff --git a/src/next/scval_conversions.rs b/src/next/scval_conversions.rs index 01f48286..0856ab81 100644 --- a/src/next/scval_conversions.rs +++ b/src/next/scval_conversions.rs @@ -559,6 +559,18 @@ impl> From> for ScVal { } } +impl From<&Option> for ScVal +where + for<'a> &'a T: Into, +{ + fn from(v: &Option) -> Self { + match v { + Some(v) => v.into(), + None => ().into(), + } + } +} + macro_rules! impl_for_tuple { ( $count:literal $($typ:ident $idx:tt)+ ) => { #[cfg(feature = "alloc")]