ir-remote 0.2.0

Create a programatic IR remote to control devices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::time::Duration;

pub trait IsAround {
    fn is_around(&self, other: Self, error: f64) -> bool;
}

impl IsAround for Duration {
    fn is_around(&self, other: Self, error: f64) -> bool {
        let lower_bound = other.mul_f64(1.0 - error);
        let upper_bound = other.mul_f64(1.0 + error);
        self >= &lower_bound && self <= &upper_bound
    }
}