diff options
author | Paul Harrison <paul@harrison.sh> | 2022-11-20 15:13:16 +0000 |
---|---|---|
committer | Paul Harrison <paul@harrison.sh> | 2022-12-15 16:02:14 +0000 |
commit | 9baafc80ed889c232587cf5d4cfaa2db44d1825a (patch) | |
tree | 13371c1220a8eabbc0932d30cc9475b98b984c3b /poker/rank | |
parent | b4ba284dcc20563b9b7dde770b7c9f67c6b25e76 (diff) |
feat: Hand ranking API
Hand ranking API with a health check root endpoint and rank endpoint.
Diffstat (limited to 'poker/rank')
-rw-r--r-- | poker/rank/hands.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/poker/rank/hands.py b/poker/rank/hands.py index 6a81af5..a622f87 100644 --- a/poker/rank/hands.py +++ b/poker/rank/hands.py @@ -162,7 +162,7 @@ def rank_hand(hand: Hand) -> RankedHand: for rank, func in _FUNCTIONS.items(): result = func(hand) if result: - out = RankedHand( + return RankedHand( cards=hand.cards, rank=rank, description=DESCRIPTIONS[rank].format(**result), @@ -170,5 +170,3 @@ def rank_hand(hand: Hand) -> RankedHand: if out is None: raise ValueError("No rank found.") - - return out |