Skip to content

Commit 3901d8b

Browse files
run cargo fmt
1 parent 910ecce commit 3901d8b

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/financial/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
mod price_plus_tax;
22

3-
pub use price_plus_tax::price_plus_tax;
3+
pub use price_plus_tax::price_plus_tax;

src/financial/price_plus_tax.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
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)]
86
mod 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
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub mod compression;
88
pub mod conversions;
99
pub mod data_structures;
1010
pub mod dynamic_programming;
11+
pub mod financial;
1112
pub mod general;
1213
pub mod geometry;
1314
pub mod graph;
@@ -19,7 +20,6 @@ pub mod number_theory;
1920
pub mod searching;
2021
pub mod sorting;
2122
pub mod string;
22-
pub mod financial;
2323

2424
#[cfg(test)]
2525
mod tests {

0 commit comments

Comments
 (0)