diff options
author | Guillermo Ramos | 2025-02-04 11:20:54 +0100 |
---|---|---|
committer | Guillermo Ramos | 2025-02-06 00:13:11 +0100 |
commit | 4b49c17f91196405ed34535336147d91a805bcf5 (patch) | |
tree | 7e252de9d1bf53a4d1383aaff086d9c05c59b714 /src/main.rs | |
parent | 8907130570df1a67d30a0266c2ba17c27975d713 (diff) | |
download | hiccup-4b49c17f91196405ed34535336147d91a805bcf5.tar.gz |
Refactor
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index bbe01af..c114f2a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,16 @@ use hiccup::Mortgage; -use hiccup::MortgageUpdate::{self, *}; +use hiccup::MortgageUpdate::*; +use hiccup::MortgageUpdates; use std::collections::HashMap; fn main() { - let mut updates: HashMap<u32, MortgageUpdate> = - HashMap::from_iter((1..29).map(|y| (y * 12, Amortize(24_000.)))); - updates.insert(0, Amortize(15_000.)); let m = Mortgage::new(390_000., 0.028, 30); + + let updates: MortgageUpdates = HashMap::from_iter((0..29).map(|y| match y { + 0 => (0, Amortize(30_000.)), + _ => (y * 12, Amortize(12_000.)), + })); m.clone().run(updates); + // m.clone().run(HashMap::new()); } |