use crate::Unit;
use crate::length::metric::Meter;
use crate::time::Time;
pub mod astronomical;
pub mod imperial;
pub mod metric;
pub mod nautical;
pub trait Velocity: Unit {
fn multiply_time(&self, rhs: &dyn Time) -> Meter {
Meter(self.to_base() * rhs.to_base())
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn multiply_with_time() {
let velocity = metric::MeterPerSecond(2.0);
let time = crate::time::metric::Hour(3.0);
let length = velocity.multiply_time(&time);
assert!((length.to_value() - 21600.0).abs() < 1e-5);
}
}