summaryrefslogtreecommitdiff
path: root/src/systems/view.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-09 23:54:24 +0100
committertroido <troido@protonmail.com>2020-02-09 23:54:24 +0100
commitb0e665f5436e08e4fd7446a59b87ac28f562a601 (patch)
treefcdeee5178606eadfe1e1b5744410bfd4fef260a /src/systems/view.rs
parentb9cfb78c20fd309929aae98f24acc8ba4a9a7481 (diff)
refactoring using cargo clippy
Diffstat (limited to 'src/systems/view.rs')
-rw-r--r--src/systems/view.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systems/view.rs b/src/systems/view.rs
index 6c0b1f8..a884d35 100644
--- a/src/systems/view.rs
+++ b/src/systems/view.rs
@@ -48,7 +48,7 @@ impl <'a> System<'a> for View {
}
- let has_changed: bool = changed.len() > 0;
+ let has_changed: bool = !changed.is_empty();
let mut changes: Vec<(Pos, Vec<String>)> = Vec::new();
for pos in changed {
changes.push((pos, cell_sprites(ground.cells.get(&pos).unwrap_or(&HashSet::new()), &visible)));
@@ -92,7 +92,7 @@ fn draw_room(ground: &HashMap<Pos, HashSet<Entity>>, (width, height): (i64, i64)
let mut mapping: Vec<Vec<String>> = Vec::new();
for y in 0..height {
for x in 0..width {
- let sprites: Vec<String> = match ground.get(&Pos{x: x, y: y}) {
+ let sprites: Vec<String> = match ground.get(&Pos{x, y}) {
Some(ents) => {cell_sprites(ents, visible)}
None => {vec![]}
};