Skip to content

Commit ec6f731

Browse files
committed
made the function more idiomatic to resolve clippy warnings
1 parent d29ce8c commit ec6f731

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/financial/compound_interest.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
// n = number of times interest is compounded per year and t = time (in years)
44

55
pub fn compound_interest(principal: f64, rate: f64, comp_per_year: u32, years: f64) -> f64 {
6-
let amount =
7-
principal * (1.00 + rate / comp_per_year as f64).powf(comp_per_year as f64 * years);
8-
amount
6+
principal * (1.00 + rate / comp_per_year as f64).powf(comp_per_year as f64 * years)
97
}
108

119
#[cfg(test)]

0 commit comments

Comments
 (0)