diff options
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()); } |