lowpass: clippy

This commit is contained in:
Robert Jördens 2021-02-10 13:27:56 +01:00
parent 30c2c2aac2
commit 13b47556fd
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ impl Lockin {
pub fn new(k: u8) -> Self { pub fn new(k: u8) -> Self {
let lp = Lowpass::default(); let lp = Lowpass::default();
Self { Self {
state: [lp.clone(), lp.clone()], state: [lp.clone(), lp],
k, k,
} }
} }

View File

@ -27,7 +27,7 @@ impl<N: ArrayLength<i32>> Lowpass<N> {
let mut x1 = self.xy[0]; let mut x1 = self.xy[0];
self.xy[0] = x; self.xy[0] = x;
for y1 in self.xy[1..].iter_mut() { for y1 in self.xy[1..].iter_mut() {
x0 = *y1 + (((x0 >> 1) + (x1 >> 1) - *y1 + (1 << k - 1)) >> k); x0 = *y1 + (((x0 >> 1) + (x1 >> 1) - *y1 + (1 << (k - 1))) >> k);
x1 = *y1; x1 = *y1;
*y1 = x0; *y1 = x0;
} }