]> git.beaudet.xyz Git - poker-eval.git/commitdiff
refactor(card): add From<Card> for u32
authorMA Beaudet <ma@beaudet.xyz>
Wed, 10 Nov 2021 20:43:40 +0000 (21:43 +0100)
committerMA Beaudet <ma@beaudet.xyz>
Wed, 10 Nov 2021 20:43:40 +0000 (21:43 +0100)
src/card.rs

index 3e72a0fb0beb806eca6f5af520c14e0a2d9c62e2..f62a14275eb852409ee8b5d25e4c793fb4ca11a0 100644 (file)
@@ -230,6 +230,12 @@ impl AsRef<u32> for Card {
     }
 }
 
+impl From<Card> for u32 {
+    fn from(c: Card) -> Self {
+        c.0
+    }
+}
+
 impl AsRef<Card> for Card {
     fn as_ref(&self) -> &Card {
         self