Skip to content

the trait From<Cow<'_, str>> is not implemented for AttrValue #2198

@Madoshakalaka

Description

@Madoshakalaka

Problem

After merging in #1994 in a project code complains

the trait `From<Cow<'_, str>>` is not implemented for `AttrValue`

Currently these are implemented:

impl From<&'static str> for AttrValue {
fn from(s: &'static str) -> Self {
AttrValue::Static(s)
}
}
impl From<String> for AttrValue {
fn from(s: String) -> Self {
AttrValue::Owned(s)
}
}
impl From<Rc<str>> for AttrValue {
fn from(s: Rc<str>) -> Self {
AttrValue::Rc(s)
}
}

Doesn't make sense to omit Cow<'_, str>, as #1994 says

This PR introduces a new type, AttrValue, for attribute values. This is a replacement for Cow<'static, str>

Environment:

  • Yew version: [master]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-yewArea: The main yew cratefeature-acceptedA feature request that has been accepted and needs implementingfeature-requestA feature request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions