Skip to content

Commit

Permalink
feat: impl IntoAttribute for Cow<'static, str> (#1945)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqwewe authored Oct 27, 2023
1 parent d10a566 commit 4b04373
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions leptos_dom/src/macro_helpers/into_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ impl IntoAttribute for &'static str {
impl_into_attr_boxed! {}
}

impl IntoAttribute for Rc<str> {
impl IntoAttribute for Cow<'static, str> {
#[inline(always)]
fn into_attribute(self) -> Attribute {
Attribute::String(Oco::Counted(self))
Attribute::String(self.into())
}

impl_into_attr_boxed! {}
Expand All @@ -183,6 +183,15 @@ impl IntoAttribute for Oco<'static, str> {
impl_into_attr_boxed! {}
}

impl IntoAttribute for Rc<str> {
#[inline(always)]
fn into_attribute(self) -> Attribute {
Attribute::String(Oco::Counted(self))
}

impl_into_attr_boxed! {}
}

impl IntoAttribute for bool {
#[inline(always)]
fn into_attribute(self) -> Attribute {
Expand Down

0 comments on commit 4b04373

Please sign in to comment.