From e396c1f04b09eb422ba6d5929f0d70d80b9f633b Mon Sep 17 00:00:00 2001 From: Trevin Chow Date: Tue, 7 Apr 2026 17:09:58 -0700 Subject: [PATCH] feat: add blanket IntoAttributeValue impl for references (#5447) * feat: add blanket IntoAttributeValue impl for references Adds `impl 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 --- packages/core/src/nodes.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 2ea10ac32..0d059bd5c 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -1123,6 +1123,12 @@ impl IntoAttributeValue for Option { } } +impl, R: IntoAttributeValue> IntoAttributeValue for &T { + fn into_value(self) -> AttributeValue { + self.to_owned().into_value() + } +} + pub struct AnyFmtMarker; impl IntoAttributeValue for T where