diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
commit | fd52e266c6e25999a49c36f17342977b759a2612 (patch) | |
tree | 9c727cac949c9698343d003ee87cfe73c6c6204a /planetwars-rules/src/serializer.rs | |
parent | f7655005ff099e8314ecd31e95b26ad74d4efd02 (diff) | |
download | planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.tar.xz planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.zip |
apply clippy suggestions
Diffstat (limited to 'planetwars-rules/src/serializer.rs')
-rw-r--r-- | planetwars-rules/src/serializer.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/planetwars-rules/src/serializer.rs b/planetwars-rules/src/serializer.rs index 7eb2e01..22ba52e 100644 --- a/planetwars-rules/src/serializer.rs +++ b/planetwars-rules/src/serializer.rs @@ -20,7 +20,7 @@ struct Serializer<'a> { impl<'a> Serializer<'a> { fn new(state: &'a PwState, offset: usize) -> Self { Serializer { - state: state, + state, player_num_offset: offset, } } @@ -49,7 +49,7 @@ impl<'a> Serializer<'a> { let num_players = self.state.players.len(); let rotated_id = (player_id + num_players - self.player_num_offset) % num_players; // protocol player ids start at 1 - return rotated_id + 1; + rotated_id + 1 } fn serialize_planet(&self, planet: &Planet) -> proto::Planet { |