diff options
| author | troido <troido@protonmail.com> | 2020-02-09 23:54:24 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-09 23:54:24 +0100 |
| commit | b0e665f5436e08e4fd7446a59b87ac28f562a601 (patch) | |
| tree | fcdeee5178606eadfe1e1b5744410bfd4fef260a /src/systems/moving.rs | |
| parent | b9cfb78c20fd309929aae98f24acc8ba4a9a7481 (diff) | |
refactoring using cargo clippy
Diffstat (limited to 'src/systems/moving.rs')
| -rw-r--r-- | src/systems/moving.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systems/moving.rs b/src/systems/moving.rs index 98b0979..3e7803d 100644 --- a/src/systems/moving.rs +++ b/src/systems/moving.rs @@ -74,8 +74,8 @@ impl <'a> System<'a> for Move { let mut pos_mut = pos.get_mut_unchecked(); moved.insert(ent, Moved{from: pos_mut.pos}).expect("can't insert Moved"); ground.cells.get_mut(&pos_mut.pos).unwrap().remove(&ent); - pos_mut.pos = newpos.clone(); - ground.cells.entry(newpos).or_insert(HashSet::new()).insert(ent); + pos_mut.pos = newpos; + ground.cells.entry(newpos).or_insert_with(HashSet::new).insert(ent); } } _ => {} |
