diff --git a/leptos_reactive/src/signal_wrappers_read.rs b/leptos_reactive/src/signal_wrappers_read.rs index 9484e9b23..6fe96d075 100644 --- a/leptos_reactive/src/signal_wrappers_read.rs +++ b/leptos_reactive/src/signal_wrappers_read.rs @@ -1,5 +1,3 @@ -use std::marker::PhantomData; - use crate::{store_value, Memo, ReadSignal, RwSignal, Scope, StoredValue, UntrackedGettableSignal}; /// A wrapper for any kind of readable reactive signal: a [ReadSignal](crate::ReadSignal), @@ -486,73 +484,3 @@ where self.get() } } - -/// Signal which only emits the default value when read. -pub struct DefaultSignal(PhantomData); - -impl Default for DefaultSignal { - fn default() -> Self { - Self(Default::default()) - } -} - -impl std::fmt::Debug for DefaultSignal { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_tuple("DefaultSignal").field(&T::default()).finish() - } -} - -impl Clone for DefaultSignal { - fn clone(&self) -> Self { - Self(PhantomData) - } -} - -impl Copy for DefaultSignal {} - -impl DefaultSignal { - /// Get's the default value of `T`. - pub fn get(self) -> T { - T::default() - } -} - -impl PartialEq for DefaultSignal { - fn eq(&self, _: &Self) -> bool { - true - } -} - -impl Eq for DefaultSignal {} - -#[cfg(not(feature = "stable"))] -impl FnOnce<()> for DefaultSignal { - type Output = T; - - extern "rust-call" fn call_once(self, _: ()) -> Self::Output { - T::default() - } -} - -#[cfg(not(feature = "stable"))] -impl FnOnce<(bool,)> for DefaultSignal { - type Output = T; - - extern "rust-call" fn call_once(self, _: (bool,)) -> Self::Output { - T::default() - } -} - -#[cfg(not(feature = "stable"))] -impl FnMut<()> for DefaultSignal { - extern "rust-call" fn call_mut(&mut self, _: ()) -> Self::Output { - T::default() - } -} - -#[cfg(not(feature = "stable"))] -impl Fn<()> for DefaultSignal { - extern "rust-call" fn call(&self, _: ()) -> Self::Output { - T::default() - } -}