diff --git a/leptos_dom/src/components/dyn_child.rs b/leptos_dom/src/components/dyn_child.rs index d05a32103..262887aca 100644 --- a/leptos_dom/src/components/dyn_child.rs +++ b/leptos_dom/src/components/dyn_child.rs @@ -383,6 +383,7 @@ cfg_if! { } impl NonViewMarkerSibling for web_sys::Node { + #[cfg_attr(not(debug_assertions), inline(always))] fn next_non_view_marker_sibling(&self) -> Option { cfg_if! { if #[cfg(debug_assertions)] { @@ -399,6 +400,7 @@ cfg_if! { } } + #[cfg_attr(not(debug_assertions), inline(always))] fn previous_non_view_marker_sibling(&self) -> Option { cfg_if! { if #[cfg(debug_assertions)] { diff --git a/leptos_dom/src/components/each.rs b/leptos_dom/src/components/each.rs index 89613ab50..9678fb051 100644 --- a/leptos_dom/src/components/each.rs +++ b/leptos_dom/src/components/each.rs @@ -155,6 +155,7 @@ impl Mountable for EachRepr { }; } + #[inline(always)] fn get_closing_node(&self) -> web_sys::Node { self.closing.node.clone() } diff --git a/leptos_dom/src/lib.rs b/leptos_dom/src/lib.rs index ee7a252af..c12b09ed0 100644 --- a/leptos_dom/src/lib.rs +++ b/leptos_dom/src/lib.rs @@ -137,6 +137,7 @@ impl IntoView for (Scope, T) where T: IntoView, { + #[inline(always)] fn into_view(self, _: Scope) -> View { self.1.into_view(self.0) } diff --git a/router/src/history/params.rs b/router/src/history/params.rs index a937ac431..260de672b 100644 --- a/router/src/history/params.rs +++ b/router/src/history/params.rs @@ -7,30 +7,36 @@ use thiserror::Error; // that O(n) iteration over a vectorized map is (*probably*) more space- // and time-efficient than hashing and using an actual `HashMap` #[derive(Debug, PartialEq, Eq, Clone)] +#[repr(transparent)] pub struct ParamsMap(pub LinearMap); impl ParamsMap { /// Creates an empty map. + #[inline(always)] pub fn new() -> Self { Self(LinearMap::new()) } /// Creates an empty map with the given capacity. + #[inline(always)] pub fn with_capacity(capacity: usize) -> Self { Self(LinearMap::with_capacity(capacity)) } /// Inserts a value into the map. + #[inline(always)] pub fn insert(&mut self, key: String, value: String) -> Option { self.0.insert(key, value) } /// Gets a value from the map. + #[inline(always)] pub fn get(&self, key: &str) -> Option<&String> { self.0.get(key) } /// Removes a value from the map. + #[inline(always)] pub fn remove(&mut self, key: &str) -> Option { self.0.remove(key) } @@ -51,6 +57,7 @@ impl ParamsMap { } impl Default for ParamsMap { + #[inline(always)] fn default() -> Self { Self::new() } @@ -95,6 +102,7 @@ where } impl Params for () { + #[inline(always)] fn from_map(_map: &ParamsMap) -> Result { Ok(()) }