Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtying committed Jan 15, 2024
1 parent e6a60d1 commit f3c7f3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/shengji_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ async fn register_user<S: Storage<VersionedGame, E>, E: std::fmt::Debug + Send>(
let mut clients_to_disconnect = vec![];
let clients = associated_websockets
.entry(assigned_player_id)
.or_insert_with(Vec::new);
.or_default();
// If the same user joined before, remove the previous entries
// from the state-store.
if !g.allows_multiple_sessions_per_user() {
Expand Down
2 changes: 1 addition & 1 deletion mechanics/src/ordered_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn subsequent_decomposition_ordering(
let mut decomp = full_decomposition_ordering(len);
decomp.reverse();
while let Some(v) = decomp.pop() {
if v.len() == 1 && v.get(0) == Some(adj_req) {
if v.len() == 1 && v.first() == Some(adj_req) {
break;
}
}
Expand Down
3 changes: 1 addition & 2 deletions mechanics/src/trick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,7 @@ impl Trick {
points: all_card_points,
largest_trick_unit_size: tf.units.iter().map(|u| u.size()).max().unwrap_or(0),
failed_throw_size: self
.played_cards
.get(0)
.played_cards.first()
.ok_or(TrickError::OutOfOrder)?
.bad_throw_cards
.len(),
Expand Down

0 comments on commit f3c7f3b

Please sign in to comment.