feat: add blanket IntoAttributeValue impl for references (#5447)
* feat: add blanket IntoAttributeValue impl for references Adds `impl<T: IntoAttributeValue + Clone> IntoAttributeValue for &T` so users don't need to explicitly dereference or clone when passing references to RSX attributes. Closes #5444 * use to-owned --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
95fdca3cbf
commit
e396c1f04b
1 file changed
+6
@@ -1123,6 +1123,12 @@ impl<T: IntoAttributeValue> IntoAttributeValue for Option<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ToOwned<Owned = R>, R: IntoAttributeValue> IntoAttributeValue for &T {
|
||||
fn into_value(self) -> AttributeValue {
|
||||
self.to_owned().into_value()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AnyFmtMarker;
|
||||
impl<T> IntoAttributeValue<AnyFmtMarker> for T
|
||||
where
|
||||
|
||||
Reference in new issue
Block a user