Skip to content

Commit

Permalink
fix!: remove clone in Cow<'static, str> IntoView impl (#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqwewe authored Jan 15, 2024
1 parent d8cbda5 commit 4616fee
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion leptos_dom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,17 @@ impl IntoView for &'static str {
}
}

impl IntoView for Cow<'static, str> {
#[cfg_attr(
any(debug_assertions, feature = "ssr"),
instrument(level = "info", name = "#text", skip_all)
)]
#[inline(always)]
fn into_view(self) -> View {
View::Text(Text::new(self.into()))
}
}

impl IntoView for Oco<'static, str> {
#[cfg_attr(
any(debug_assertions, feature = "ssr"),
Expand Down Expand Up @@ -1225,7 +1236,6 @@ viewable_primitive![
f64,
char,
bool,
Cow<'_, str>,
std::net::IpAddr,
std::net::SocketAddr,
std::net::SocketAddrV4,
Expand Down

0 comments on commit 4616fee

Please sign in to comment.