Skip to content

Commit

Permalink
fix(clippy): apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Dec 31, 2023
1 parent 95f8dac commit 3163013
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Game {
///
/// Also see [`Game::is_ready`]
pub fn add_player(&mut self, player: Player) -> Result<()> {
if self.players.get(0).is_none() {
if self.players.first().is_none() {
self.players.push(player);
self.players[0].send("Waiting for opponent...\n")?;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ mod tests {
#[ignore]
fn test_player() -> Result<()> {
let address = "0.0.0.0:3333";
let listener = TcpListener::bind(&address)?;
let listener = TcpListener::bind(address)?;
thread::spawn(move || listener.accept());
let stream = TcpStream::connect(&address)?;
let stream = TcpStream::connect(address)?;
let mut player = Player::new(stream);
player.greet()?;
assert_eq!("unknown player", player.name);
Expand Down

0 comments on commit 3163013

Please sign in to comment.