Feature Request
When I write a component with rsx and I want to add a label, content or put a value, it usually has to be converted IntoAttributeValue first. However, if I provide a reference, for example a &&str or &f32, I would need to Copy/Clone the value first in order to use it.
let test: &'static &'static str = i18n.some_component().some_value();
rsx! {
span {
{*test}
}
}
So I suggest this convenience impl, that does it under the hood.
Implement Suggestion
impl<T> IntoAttributeValue for &T
where
T: IntoAttributeValue + Clone,
{
fn into_value(self) -> AttributeValue {
self.clone().into_value()
}
}
Feature Request
When I write a component with rsx and I want to add a label, content or put a value, it usually has to be converted IntoAttributeValue first. However, if I provide a reference, for example a &&str or &f32, I would need to Copy/Clone the value first in order to use it.
So I suggest this convenience impl, that does it under the hood.
Implement Suggestion