Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Sep 27, 2024
1 parent 53426d7 commit b18b316
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
14 changes: 12 additions & 2 deletions src/tests/peer/potato_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ impl ToLocalUI for Pipe {
Ok(())
}

fn opponent_moved(&mut self, _allocator: &mut AllocEncoder, id: &GameID, readable: ReadableMove) -> Result<(), Error> {
fn opponent_moved(
&mut self,
_allocator: &mut AllocEncoder,
id: &GameID,
readable: ReadableMove,
) -> Result<(), Error> {
self.opponent_moves.push((id.clone(), readable));
Ok(())
}
Expand All @@ -147,7 +152,12 @@ impl ToLocalUI for Pipe {
.push((id.clone(), readable.to_vec()));
Ok(())
}
fn game_message(&mut self, _allocator: &mut AllocEncoder, id: &GameID, readable: ReadableMove) -> Result<(), Error> {
fn game_message(
&mut self,
_allocator: &mut AllocEncoder,
id: &GameID,
readable: ReadableMove,
) -> Result<(), Error> {
self.opponent_messages.push((id.clone(), readable));
Ok(())
}
Expand Down
28 changes: 24 additions & 4 deletions src/tests/peer/potato_handler_sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ impl BootstrapTowardWallet for SimulatedPeer {
}

impl ToLocalUI for SimulatedPeer {
fn opponent_moved(&mut self, _allocator: &mut AllocEncoder, _id: &GameID, _readable: ReadableMove) -> Result<(), Error> {
fn opponent_moved(
&mut self,
_allocator: &mut AllocEncoder,
_id: &GameID,
_readable: ReadableMove,
) -> Result<(), Error> {
// We can record stuff here and check that we got what was expected, but there's
// no effect on the game mechanics.
Ok(())
Expand All @@ -243,7 +248,12 @@ impl ToLocalUI for SimulatedPeer {
self.raw_messages.push(readable.to_vec());
Ok(())
}
fn game_message(&mut self, _allocator: &mut AllocEncoder, _id: &GameID, readable: ReadableMove) -> Result<(), Error> {
fn game_message(
&mut self,
_allocator: &mut AllocEncoder,
_id: &GameID,
readable: ReadableMove,
) -> Result<(), Error> {
// Record for testing, but doens't affect the game.
self.messages.push(readable);
Ok(())
Expand Down Expand Up @@ -698,12 +708,22 @@ struct LocalTestUIReceiver {
}

impl ToLocalUI for LocalTestUIReceiver {
fn opponent_moved(&mut self, _allocator: &mut AllocEncoder, _id: &GameID, _readable: ReadableMove) -> Result<(), Error> {
fn opponent_moved(
&mut self,
_allocator: &mut AllocEncoder,
_id: &GameID,
_readable: ReadableMove,
) -> Result<(), Error> {
self.opponent_moved = true;
Ok(())
}

fn game_message(&mut self, _allocator: &mut AllocEncoder, _id: &GameID, _readable: ReadableMove) -> Result<(), Error> {
fn game_message(
&mut self,
_allocator: &mut AllocEncoder,
_id: &GameID,
_readable: ReadableMove,
) -> Result<(), Error> {
Ok(())
}

Expand Down

0 comments on commit b18b316

Please sign in to comment.