Skip to content

Commit

Permalink
chore: resolve 1.78.0 clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pbellchambers committed May 9, 2024
1 parent bc8cbbc commit de7c3fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Currently, the following functionality is defined entirely by text or json files
- **spawns** - *.json* - Spawn locations of monsters. There should be one spawn file per map.

## Building from source
1. Install latest version of [rust](https://www.rust-lang.org/) (most recently confirmed working `1.77.0`)
1. Install latest version of [rust](https://www.rust-lang.org/) (most recently confirmed working `1.78.0`)
2. Download this repository
3. Run `cargo build` in the repository root directory
4. Copy `assets` directory into `target/debug` directory
Expand Down
2 changes: 1 addition & 1 deletion rustyhack_server/src/game/ecs/queries/change_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub(crate) fn change_map_request(
if position_message.position.pos_x == exit.x
&& position_message.position.pos_y == exit.y
{
player_position.current_map = exit.new_map.clone();
player_position.current_map.clone_from(&exit.new_map);
player_position.pos_x = exit.new_x;
player_position.pos_y = exit.new_y;
player_position.velocity_x = 0;
Expand Down
2 changes: 1 addition & 1 deletion rustyhack_server/src/game/ecs/queries/player_joined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) fn join_player(
for (player_details, display_details, position, stats, inventory) in query.iter_mut(world) {
if player_details.player_name == name && !player_details.currently_online {
player_details.currently_online = true;
player_details.client_addr = client_addr.clone();
player_details.client_addr.clone_from(&client_addr);
display_details.collidable = true;
display_details.visible = true;
info!(
Expand Down
4 changes: 2 additions & 2 deletions rustyhack_server/src/game/ecs/queries/player_left.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) fn set_player_logged_out(
&& player_details.player_name == originating_player_name
{
logged_out_id = player_details.id;
logged_out_map = position.current_map.clone();
logged_out_map.clone_from(&position.current_map);
display_details.visible = false;
display_details.collidable = false;
player_details.currently_online = false;
Expand All @@ -44,7 +44,7 @@ pub(crate) fn set_player_disconnected(world: &mut World, address: &str) -> (Uuid
for (player_details, display_details, position) in query.iter_mut(world) {
if player_details.client_addr == address {
logged_out_id = player_details.id;
logged_out_map = position.current_map.clone();
logged_out_map.clone_from(&position.current_map);
display_details.visible = false;
display_details.collidable = false;
player_details.currently_online = false;
Expand Down

0 comments on commit de7c3fa

Please sign in to comment.