File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33use serde:: { Deserialize , Serialize } ;
44use std:: fmt;
5- use std:: ops:: { AddAssign , SubAssign } ;
5+ use std:: ops:: { AddAssign , Mul , SubAssign } ;
66
77macro_rules! base_unit_struct {
88 ( $name: ident) => {
@@ -20,12 +20,6 @@ macro_rules! base_unit_struct {
2020 ) ]
2121 pub struct $name( pub f64 ) ;
2222
23- impl std:: ops:: Mul <$name> for $name {
24- type Output = $name;
25- fn mul( self , rhs: $name) -> $name {
26- $name( self . 0 * rhs. 0 )
27- }
28- }
2923 impl std:: ops:: Div <$name> for $name {
3024 type Output = Dimensionless ;
3125 fn div( self , rhs: $name) -> Dimensionless {
@@ -94,6 +88,14 @@ impl From<Dimensionless> for f64 {
9488 }
9589}
9690
91+ impl Mul for Dimensionless {
92+ type Output = Dimensionless ;
93+
94+ fn mul ( self , rhs : Self ) -> Self :: Output {
95+ Dimensionless ( self . 0 * rhs. 0 )
96+ }
97+ }
98+
9799impl Dimensionless {
98100 /// Raises this dimensionless number to the power of `rhs`.
99101 pub fn powi ( self , rhs : i32 ) -> Self {
You can’t perform that action at this time.
0 commit comments