remove signal function call Read implementations (dead code)

This commit is contained in:
Greg Johnston 2024-05-31 12:20:21 -04:00
parent 4215cef04b
commit 2e31177f62
1 changed files with 1 additions and 77 deletions

View File

@ -4,51 +4,13 @@ use crate::{
ArcReadSignal, ArcRwSignal, ArcWriteSignal, ReadSignal, RwSignal,
WriteSignal,
},
traits::{Get, Read, Set},
traits::{Get, Set},
wrappers::{
read::{ArcSignal, Signal},
write::SignalSetter,
},
};
macro_rules! impl_get_fn_traits_read {
($($ty:ident $(($method_name:ident))?),*) => {
$(
#[cfg(feature = "nightly")]
impl<T: 'static> FnOnce<()> for $ty<T> {
type Output = <Self as Read>::Value;
#[inline(always)]
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
impl_get_fn_traits_read!(@method_name self $($method_name)?)
}
}
#[cfg(feature = "nightly")]
impl<T: 'static> FnMut<()> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call_mut(&mut self, _args: ()) -> Self::Output {
impl_get_fn_traits_read!(@method_name self $($method_name)?)
}
}
#[cfg(feature = "nightly")]
impl<T: 'static> Fn<()> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call(&self, _args: ()) -> Self::Output {
impl_get_fn_traits_read!(@method_name self $($method_name)?)
}
}
)*
};
(@method_name $self:ident) => {
$self.read()
};
(@method_name $self:ident $ident:ident) => {
$self.$ident()
};
}
macro_rules! impl_set_fn_traits {
($($ty:ident $($method_name:ident)?),*) => {
$(
@ -87,44 +49,6 @@ macro_rules! impl_set_fn_traits {
};
}
macro_rules! impl_get_fn_traits_read_send {
($($ty:ident $(($method_name:ident))?),*) => {
$(
#[cfg(feature = "nightly")]
impl<T: Send + Sync + 'static> FnOnce<()> for $ty<T> {
type Output = <Self as Read>::Value;
#[inline(always)]
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
impl_get_fn_traits_read_send!(@method_name self $($method_name)?)
}
}
#[cfg(feature = "nightly")]
impl<T: Send + Sync + 'static> FnMut<()> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call_mut(&mut self, _args: ()) -> Self::Output {
impl_get_fn_traits_read_send!(@method_name self $($method_name)?)
}
}
#[cfg(feature = "nightly")]
impl<T: Send + Sync + 'static> Fn<()> for $ty<T> {
#[inline(always)]
extern "rust-call" fn call(&self, _args: ()) -> Self::Output {
impl_get_fn_traits_read_send!(@method_name self $($method_name)?)
}
}
)*
};
(@method_name $self:ident) => {
$self.read()
};
(@method_name $self:ident $ident:ident) => {
$self.$ident()
};
}
macro_rules! impl_get_fn_traits_get {
($($ty:ident $(($method_name:ident))?),*) => {
$(