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:
Trevin ChowandJonathan Kelley authored and GitHub committed 2026-04-07 17:09:58 -07:00
1 parent 95fdca3cbf
commit e396c1f04b
1 file changed
+6
+6
View File
@@ -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