refactor~(core): use traits and structs for interpolation

We have to now pass the interpolation method as a generic argument to methods.
This commit is contained in:
Anand Balakrishnan 2023-06-07 09:57:56 -04:00
parent 2b16ef9c40
commit 87afc11b90
No known key found for this signature in database
8 changed files with 314 additions and 306 deletions

View file

@ -1,3 +1,4 @@
use super::interpolation::Linear;
use crate::signals::utils::{apply1, apply2};
use crate::signals::Signal;
@ -13,7 +14,7 @@ impl core::ops::BitAnd<Self> for &Signal<bool> {
type Output = Signal<bool>;
fn bitand(self, other: Self) -> Self::Output {
apply2(self, other, |lhs, rhs| lhs && rhs)
apply2::<_, _, _, Linear>(self, other, |lhs, rhs| lhs && rhs)
}
}
@ -21,6 +22,6 @@ impl core::ops::BitOr<Self> for &Signal<bool> {
type Output = Signal<bool>;
fn bitor(self, other: Self) -> Self::Output {
apply2(self, other, |lhs, rhs| lhs || rhs)
apply2::<_, _, _, Linear>(self, other, |lhs, rhs| lhs || rhs)
}
}