From 8da2fd6c21b33a9bf2bc89d52f4318553a22bfff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Thu, 26 Oct 2023 10:03:04 +0200 Subject: [PATCH] filter: less pub --- src/filter.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filter.rs b/src/filter.rs index 173c195..db1a85b 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -17,7 +17,7 @@ pub trait Filter { } #[derive(Copy, Clone, Default)] -pub struct Nyquist(pub(crate) i32); +pub struct Nyquist(i32); impl Filter for Nyquist { type Config = (); fn update(&mut self, x: i32, _k: &Self::Config) -> i32 { @@ -35,8 +35,8 @@ impl Filter for Nyquist { } #[derive(Copy, Clone)] -pub struct Chain(pub(crate) [T; N]); -impl Filter for Chain { +pub struct Repeat([T; N]); +impl Filter for Repeat { type Config = T::Config; fn update(&mut self, x: i32, k: &Self::Config) -> i32 { self.0.iter_mut().fold(x, |x, stage| stage.update(x, k)) @@ -48,14 +48,14 @@ impl Filter for Chain { self.0.iter_mut().for_each(|stage| stage.set(x)); } } -impl Default for Chain { +impl Default for Repeat { fn default() -> Self { Self([T::default(); N]) } } #[derive(Copy, Clone, Default)] -pub struct Cascade(pub(crate) T, U); +pub struct Cascade(T, U); impl Filter for Cascade { type Config = (T::Config, U::Config); fn update(&mut self, x: i32, k: &Self::Config) -> i32 {