From: MA Beaudet Date: Sun, 7 Nov 2021 19:32:32 +0000 (+0100) Subject: fix!: removen in Cards struct renamed to get X-Git-Url: https://git.beaudet.xyz/?a=commitdiff_plain;h=911419ef13bcbca26173bc895bb6c84e152da85b;p=poker-eval.git fix!: removen in Cards struct renamed to get --- diff --git a/examples/simulation.rs b/examples/simulation.rs index f4c972d..f7f84e8 100644 --- a/examples/simulation.rs +++ b/examples/simulation.rs @@ -11,7 +11,7 @@ fn main() { .map(|_| Cards::new().with_rules(&rules, &mut deck).clone()) .collect(); let mut table = Cards::new(); - table.with_cards(deck.removen(5).unwrap()); + table.with_cards(deck.get(5).unwrap()); let result = Evaluator::new() .with_rules(&rules) diff --git a/src/lib.rs b/src/lib.rs index 45a6f11..e173037 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -193,17 +193,17 @@ impl Cards { pub fn with_rules<'a>(&'a mut self, rules: &Rules, deck: &mut Cards) -> &'a mut Cards { match rules { Rules::Classic => { - self.with_cards(deck.removen(5).unwrap()); + self.with_cards(deck.get(5).unwrap()); } Rules::Holdem => { - self.with_cards(deck.removen(2).unwrap()); + self.with_cards(deck.get(2).unwrap()); } }; self } - pub fn removen(&mut self, n: usize) -> Option { + pub fn get(&mut self, n: usize) -> Option { if self.0.len() < n { None } else {