33#![ warn( clippy:: allow_attributes) ]
44use quantity:: { Quantity , SIUnit } ;
55use std:: ops:: { Div , Mul } ;
6- use typenum:: Integer ;
76
87/// Print messages with level `Verbosity::Iter` or higher.
98#[ macro_export]
@@ -132,20 +131,20 @@ const fn powi(x: f64, n: i32) -> f64 {
132131/// Conversion between reduced units and SI units.
133132pub trait ReferenceSystem {
134133 type Inner ;
135- type T : Integer ;
136- type L : Integer ;
137- type M : Integer ;
138- type I : Integer ;
139- type THETA : Integer ;
140- type N : Integer ;
141- type J : Integer ;
142- const FACTOR : f64 = powi ( REFERENCE_VALUES [ 0 ] , Self :: T :: I32 )
143- * powi ( REFERENCE_VALUES [ 1 ] , Self :: L :: I32 )
144- * powi ( REFERENCE_VALUES [ 2 ] , Self :: M :: I32 )
145- * powi ( REFERENCE_VALUES [ 3 ] , Self :: I :: I32 )
146- * powi ( REFERENCE_VALUES [ 4 ] , Self :: THETA :: I32 )
147- * powi ( REFERENCE_VALUES [ 5 ] , Self :: N :: I32 )
148- * powi ( REFERENCE_VALUES [ 6 ] , Self :: J :: I32 ) ;
134+ const T : i8 ;
135+ const L : i8 ;
136+ const M : i8 ;
137+ const I : i8 ;
138+ const THETA : i8 ;
139+ const N : i8 ;
140+ const J : i8 ;
141+ const FACTOR : f64 = powi ( REFERENCE_VALUES [ 0 ] , Self :: T as i32 )
142+ * powi ( REFERENCE_VALUES [ 1 ] , Self :: L as i32 )
143+ * powi ( REFERENCE_VALUES [ 2 ] , Self :: M as i32 )
144+ * powi ( REFERENCE_VALUES [ 3 ] , Self :: I as i32 )
145+ * powi ( REFERENCE_VALUES [ 4 ] , Self :: THETA as i32 )
146+ * powi ( REFERENCE_VALUES [ 5 ] , Self :: N as i32 )
147+ * powi ( REFERENCE_VALUES [ 6 ] , Self :: J as i32 ) ;
149148
150149 fn from_reduced ( value : Self :: Inner ) -> Self
151150 where
@@ -161,17 +160,25 @@ pub trait ReferenceSystem {
161160}
162161
163162/// Conversion to and from reduced units
164- impl < Inner , T : Integer , L : Integer , M : Integer , I : Integer , THETA : Integer , N : Integer , J : Integer >
165- ReferenceSystem for Quantity < Inner , SIUnit < T , L , M , I , THETA , N , J > >
163+ impl <
164+ Inner ,
165+ const T : i8 ,
166+ const L : i8 ,
167+ const M : i8 ,
168+ const I : i8 ,
169+ const THETA : i8 ,
170+ const N : i8 ,
171+ const J : i8 ,
172+ > ReferenceSystem for Quantity < Inner , SIUnit < T , L , M , I , THETA , N , J > >
166173{
167174 type Inner = Inner ;
168- type T = T ;
169- type L = L ;
170- type M = M ;
171- type I = I ;
172- type THETA = THETA ;
173- type N = N ;
174- type J = J ;
175+ const T : i8 = T ;
176+ const L : i8 = L ;
177+ const M : i8 = M ;
178+ const I : i8 = I ;
179+ const THETA : i8 = THETA ;
180+ const N : i8 = N ;
181+ const J : i8 = J ;
175182 fn from_reduced ( value : Inner ) -> Self
176183 where
177184 Inner : Mul < f64 , Output = Inner > ,
0 commit comments