Skip to content

Commit

Permalink
Impl IntoOptPropValue for Option<V> -> Option<T> (#1834)
Browse files Browse the repository at this point in the history
* Impl IntoOptPropValue for Option<V> -> Option<T>

The only implmented types passed to impl_into_prop macro

* Update packages/yew/src/html/conversion.rs

sure

Co-authored-by: Simon <[email protected]>

Co-authored-by: Simon <[email protected]>
  • Loading branch information
MuhannadAlrusayni and siku2 authored May 8, 2021
1 parent 99d5088 commit aaf1ec5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/yew/src/html/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ macro_rules! impl_into_prop {
Some({ $conversion })
}
}
// implement Option<V> -> Option<T>
impl IntoOptPropValue<$to_ty> for Option<$from_ty> {
fn into_opt_prop_value(self) -> Option<$to_ty> {
self.map(IntoPropValue::into_prop_value)
}
}
};
}

Expand Down

0 comments on commit aaf1ec5

Please sign in to comment.