diff --git a/foyer-storage/src/admission.rs b/foyer-storage/src/admission.rs index f80cd3d3..b953a4f7 100644 --- a/foyer-storage/src/admission.rs +++ b/foyer-storage/src/admission.rs @@ -25,9 +25,15 @@ pub trait AdmissionPolicy: Send + Sync + 'static + Debug { fn judge(&self, key: &Self::Key, value: &Self::Value) -> bool; } -#[derive(Debug, Default)] +#[derive(Debug)] pub struct AdmitAll(PhantomData<(K, V)>); +impl Default for AdmitAll { + fn default() -> Self { + Self(PhantomData) + } +} + impl AdmissionPolicy for AdmitAll { type Key = K; diff --git a/foyer-storage/src/reinsertion.rs b/foyer-storage/src/reinsertion.rs index 96ca5b13..9928a86f 100644 --- a/foyer-storage/src/reinsertion.rs +++ b/foyer-storage/src/reinsertion.rs @@ -25,9 +25,15 @@ pub trait ReinsertionPolicy: Send + Sync + 'static + Clone + Debug { fn judge(&self, key: &Self::Key, value: &Self::Value) -> bool; } -#[derive(Debug, Default)] +#[derive(Debug)] pub struct ReinsertNone(PhantomData<(K, V)>); +impl Default for ReinsertNone { + fn default() -> Self { + Self(PhantomData) + } +} + impl Clone for ReinsertNone { fn clone(&self) -> Self { Self(PhantomData)