diff --git a/src/rate.rs b/src/rate.rs index b855c6b..0819989 100644 --- a/src/rate.rs +++ b/src/rate.rs @@ -13,6 +13,7 @@ pub use fixed_point::FixedPoint as _; use num::{CheckedDiv, CheckedMul}; #[doc(inline)] pub use units::*; +use core::ops::Mul; /// An unsigned, fixed-point rate type /// @@ -370,6 +371,17 @@ impl Generic { impl Rate for Generic {} +impl Mul for Generic { + type Output = Generic; + + fn mul(self, rhs: T) -> Self::Output { + Self { + integer: self.integer * rhs, + scaling_factor: self.scaling_factor, + } + } +} + /// Rate-type units #[doc(hidden)] pub mod units {