]> git.beaudet.xyz Git - poker-eval.git/commitdiff
fix!: removen in Cards struct renamed to get
authorMA Beaudet <ma@beaudet.xyz>
Sun, 7 Nov 2021 19:32:32 +0000 (20:32 +0100)
committerMA Beaudet <ma@beaudet.xyz>
Sun, 7 Nov 2021 19:32:32 +0000 (20:32 +0100)
examples/simulation.rs
src/lib.rs

index f4c972dd97c851d1b514d632fa11a6b55861851a..f7f84e8279ae22edac4448845244a9db5eb0b7dd 100644 (file)
@@ -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)
index 45a6f11d1b9646a9083411b28b168716a45d0fbf..e173037c19a13d2e9ba8bb97c8400d9f26c635f3 100644 (file)
@@ -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<Cards> {
+    pub fn get(&mut self, n: usize) -> Option<Cards> {
         if self.0.len() < n {
             None
         } else {