diff --git a/src/notification/notifier.rs b/src/notification/notifier.rs index 079a6f54..884ec247 100644 --- a/src/notification/notifier.rs +++ b/src/notification/notifier.rs @@ -89,15 +89,17 @@ impl RemovalNotifier { pub(crate) struct BlockingRemovalNotifier { listener: EvictionListener, is_enabled: AtomicBool, + #[cfg(feature = "logging")] cache_name: Option, } impl BlockingRemovalNotifier { - fn new(listener: EvictionListener, cache_name: Option) -> Self { + fn new(listener: EvictionListener, _cache_name: Option) -> Self { Self { listener, is_enabled: AtomicBool::new(true), - cache_name, + #[cfg(feature = "logging")] + cache_name: _cache_name, } } @@ -147,14 +149,15 @@ impl Drop for ThreadPoolRemovalNotifier { } impl ThreadPoolRemovalNotifier { - fn new(listener: EvictionListener, cache_name: Option) -> Self { + fn new(listener: EvictionListener, _cache_name: Option) -> Self { let (snd, rcv) = crossbeam_channel::bounded(CHANNEL_CAPACITY); let thread_pool = ThreadPoolRegistry::acquire_pool(PoolName::RemovalNotifier); let state = NotifierState { task_lock: Default::default(), rcv, listener, - cache_name, + #[cfg(feature = "logging")] + cache_name: _cache_name, is_enabled: AtomicBool::new(true), is_running: Default::default(), is_shutting_down: Default::default(), @@ -314,6 +317,7 @@ struct NotifierState { task_lock: Mutex<()>, rcv: Receiver>, listener: EvictionListener, + #[cfg(feature = "logging")] cache_name: Option, is_enabled: AtomicBool, is_running: AtomicBool,