Remove `HydrationKey` from `leptos_reactive`

This commit is contained in:
Greg Johnston 2022-12-18 16:23:04 -05:00
parent e8aaa77160
commit eb573bf242
1 changed files with 1 additions and 23 deletions

View File

@ -330,26 +330,4 @@ impl fmt::Debug for ScopeDisposer {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("ScopeDisposer").finish()
}
}
/// This struct is used for hydrating the leptos views from the DOM.
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct HydrationKey(pub usize);
impl HydrationKey {
/// Converts the [`HydrationKey`] into a string, suitable for
/// SSR or looking up the node for hydration.
pub fn to_string(&self, closing: bool) -> String {
#[cfg(debug_assertions)]
return format!("_{}{}", self.0, if closing { 'c' } else { 'o' });
#[cfg(not(debug_assertions))]
return format!("_{}", self.0);
}
}
impl fmt::Display for HydrationKey {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
}