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:
parent
2b16ef9c40
commit
87afc11b90
8 changed files with 314 additions and 306 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue