1
0
Fork 0

Add an is_smoothing() check

This commit is contained in:
Robbert van der Helm 2022-02-03 16:51:35 +01:00
parent 82dfee9313
commit 30609c3ecd

View file

@ -71,6 +71,12 @@ impl<T: Default> Smoother<T> {
pub fn none() -> Self {
Default::default()
}
/// Whether calling [next] will yield a new value or an old value. Useful if you need to
/// recompute something wheenver this parameter changes.
pub fn is_smoothing(&self) -> bool {
self.steps_left > 0
}
}
// These are not iterators for the sole reason that this will always yield a value, and needing to