diff --git a/src/vary_middleware.rs b/src/vary_middleware.rs index 0904c16..2146643 100644 --- a/src/vary_middleware.rs +++ b/src/vary_middleware.rs @@ -24,6 +24,8 @@ pub trait Notifier { sender.send(()).ok(); } } + + fn insert_into_extensions(extensions: &mut Extensions) -> Receiver<()>; } macro_rules! define_notifiers { @@ -36,9 +38,7 @@ macro_rules! define_notifiers { fn sender(&mut self) -> Option> { self.0.take().and_then(Arc::into_inner) } - } - impl $name { fn insert_into_extensions(extensions: &mut Extensions) -> Receiver<()> { let (tx, rx) = oneshot::channel(); if extensions.insert(Self(Some(Arc::new(tx)))).is_some() {