*: young clippy back at it again

This commit is contained in:
2026-04-02 02:25:48 +01:00
parent 91b40ed412
commit 69c012e47a
3 changed files with 5 additions and 6 deletions

View File

@@ -78,11 +78,11 @@ impl Card {
}
pub fn rank(&self) -> Option<Rank> {
self.playing_card().and_then(|pc| Some(pc.rank))
self.playing_card().map(|pc| pc.rank)
}
pub fn suit(&self) -> Option<Suit> {
self.playing_card().and_then(|pc| Some(pc.suit))
self.playing_card().map(|pc| pc.suit)
}
}
@@ -226,7 +226,7 @@ mod traits_numerics {
impl From<PlayingCard> for i64 {
fn from(card: PlayingCard) -> i64 {
let deck = card.deck as i64;
let deck = card.deck;
let rank = card.rank as i64;
let suit = card.suit as i64;
(deck * 52) + (rank * 4) + suit

View File

@@ -93,8 +93,7 @@ fn try_poker_hand(num_jokers: usize, cards: &[Card]) -> Option<PokerType> {
let (highest_rank_freq, num_pairs) = {
let mut highest_rank_freq = 0;
let mut num_pairs = 0;
for i in 0..counter_ranks.len() {
let rank_freq = counter_ranks[i];
for rank_freq in counter_ranks {
highest_rank_freq = std::cmp::max(rank_freq, highest_rank_freq);
if rank_freq == 2 {
num_pairs += 1

View File

@@ -29,7 +29,7 @@ fn main() {
}
println!();
let hand = classify(&hand);
let hand = classify(hand);
match hand {
Some(hand) => println!("{}", hand),
None => println!("Not a hand"),