mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Implement IntoPropValue for Rc<str> (#2285)
* add IntoPropValue implementations for Rc<str> * add test * update test logs which record the new impls
This commit is contained in:
parent
75864e8ae5
commit
a166815b88
@ -346,7 +346,7 @@ error[E0277]: the trait bound `{integer}: IntoPropValue<String>` is not satisfie
|
||||
<&'static str as IntoPropValue<Classes>>
|
||||
<&'static str as IntoPropValue<Option<AttrValue>>>
|
||||
<&'static str as IntoPropValue<Option<String>>>
|
||||
and 12 others
|
||||
and 15 others
|
||||
|
||||
error[E0277]: the trait bound `{integer}: IntoPropValue<String>` is not satisfied
|
||||
--> tests/html_macro/component-fail.rs:79:34
|
||||
@ -359,7 +359,7 @@ error[E0277]: the trait bound `{integer}: IntoPropValue<String>` is not satisfie
|
||||
<&'static str as IntoPropValue<Classes>>
|
||||
<&'static str as IntoPropValue<Option<AttrValue>>>
|
||||
<&'static str as IntoPropValue<Option<String>>>
|
||||
and 12 others
|
||||
and 15 others
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> tests/html_macro/component-fail.rs:80:31
|
||||
|
||||
@ -288,6 +288,7 @@ error[E0277]: the trait bound `Option<NotToString>: IntoPropValue<Option<AttrVal
|
||||
<Option<&'static str> as IntoPropValue<Option<AttrValue>>>
|
||||
<Option<&'static str> as IntoPropValue<Option<String>>>
|
||||
<Option<String> as IntoPropValue<Option<AttrValue>>>
|
||||
<Option<std::rc::Rc<str>> as IntoPropValue<Option<AttrValue>>>
|
||||
= note: required by `into_prop_value`
|
||||
|
||||
error[E0277]: the trait bound `Option<{integer}>: IntoPropValue<Option<AttrValue>>` is not satisfied
|
||||
@ -300,6 +301,7 @@ error[E0277]: the trait bound `Option<{integer}>: IntoPropValue<Option<AttrValue
|
||||
<Option<&'static str> as IntoPropValue<Option<AttrValue>>>
|
||||
<Option<&'static str> as IntoPropValue<Option<String>>>
|
||||
<Option<String> as IntoPropValue<Option<AttrValue>>>
|
||||
<Option<std::rc::Rc<str>> as IntoPropValue<Option<AttrValue>>>
|
||||
= note: required by `into_prop_value`
|
||||
|
||||
error[E0277]: expected a `Fn<(MouseEvent,)>` closure, found `{integer}`
|
||||
@ -384,6 +386,7 @@ error[E0277]: the trait bound `Option<yew::NodeRef>: IntoPropValue<yew::NodeRef>
|
||||
<Option<&'static str> as IntoPropValue<Option<AttrValue>>>
|
||||
<Option<&'static str> as IntoPropValue<Option<String>>>
|
||||
<Option<String> as IntoPropValue<Option<AttrValue>>>
|
||||
<Option<std::rc::Rc<str>> as IntoPropValue<Option<AttrValue>>>
|
||||
= note: required by `into_prop_value`
|
||||
|
||||
error[E0277]: expected a `Fn<(MouseEvent,)>` closure, found `yew::Callback<String>`
|
||||
|
||||
@ -86,6 +86,7 @@ impl_into_prop!(|value: &'static str| -> String { value.to_owned() });
|
||||
|
||||
impl_into_prop!(|value: &'static str| -> AttrValue { AttrValue::Static(value) });
|
||||
impl_into_prop!(|value: String| -> AttrValue { AttrValue::Owned(value) });
|
||||
impl_into_prop!(|value: Rc<str>| -> AttrValue { AttrValue::Rc(value) });
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
@ -97,5 +98,6 @@ mod test {
|
||||
let _: Option<String> = "foo".into_prop_value();
|
||||
let _: AttrValue = "foo".into_prop_value();
|
||||
let _: Option<AttrValue> = "foo".into_prop_value();
|
||||
let _: Option<AttrValue> = Rc::<str>::from("foo").into_prop_value();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user