summaryrefslogtreecommitdiff
path: root/src/systems/view.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-03 20:44:51 +0100
committertroido <troido@protonmail.com>2020-02-03 20:44:51 +0100
commit26ab89d8125f4cb10d43dfeb67ac87ffb80656cb (patch)
tree17243129a6290452273f22aa3fd54e2dbae4a182 /src/systems/view.rs
parent4bfa58f1316a18466d40488e46a6d3c8023f9643 (diff)
removed more unwraps and expects
Diffstat (limited to 'src/systems/view.rs')
-rw-r--r--src/systems/view.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systems/view.rs b/src/systems/view.rs
index 334d71c..280b489 100644
--- a/src/systems/view.rs
+++ b/src/systems/view.rs
@@ -72,7 +72,7 @@ impl <'a> System<'a> for View {
let has_changed: bool = changed.len() > 0;
let mut changes: Vec<(Pos, Vec<String>)> = Vec::new();
for pos in changed {
- changes.push((pos, cells.get(&pos).unwrap().iter().map(|v| v.sprite.clone()).collect()));
+ changes.push((pos, cells.get(&pos).unwrap_or(&Vec::new()).iter().map(|v| v.sprite.clone()).collect()));
}
let changed_msg = WorldUpdate::Change(changes);