File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 11mod price_plus_tax;
22
3- pub use price_plus_tax:: price_plus_tax;
3+ pub use price_plus_tax:: price_plus_tax;
Original file line number Diff line number Diff line change 1- pub fn price_plus_tax ( price : f64 , tax_rate : f64 ) -> f64 {
2- price * ( 1 as f64 + tax_rate)
3- }
4-
5-
1+ pub fn price_plus_tax ( price : f64 , tax_rate : f64 ) -> f64 {
2+ price * ( 1_f64 + tax_rate)
3+ }
64
75#[ cfg( test) ]
86mod tests {
97 use super :: * ;
108
119 #[ test]
1210 fn test_price_plus_tax ( ) {
13- assert_eq ! ( 131.775 , price_plus_tax( 125.50 , 0.05 ) ) ;
14- assert_eq ! ( 125.0 , price_plus_tax( 100.0 , 0.25 ) ) ;
11+ assert_eq ! ( 131.775 , price_plus_tax( 125.50 , 0.05 ) ) ;
12+ assert_eq ! ( 125.0 , price_plus_tax( 100.0 , 0.25 ) ) ;
1513 }
1614}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ pub mod compression;
88pub mod conversions;
99pub mod data_structures;
1010pub mod dynamic_programming;
11+ pub mod financial;
1112pub mod general;
1213pub mod geometry;
1314pub mod graph;
@@ -19,7 +20,6 @@ pub mod number_theory;
1920pub mod searching;
2021pub mod sorting;
2122pub mod string;
22- pub mod financial;
2323
2424#[ cfg( test) ]
2525mod tests {
You can’t perform that action at this time.
0 commit comments