Last active
March 6, 2019 14:28
-
-
Save xla/4475090ad1dd00d82f216e302630268d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in 0..map.width { | |
let entity = match map.tiles.get(&(x, y)) { | |
Some(entity) => *entity, | |
None => { | |
let entity = entities.create(); | |
map.tiles.insert((x, y), entity); | |
entity | |
} | |
}; | |
kinds.insert(entity, EntityKind::Empty).unwrap(); | |
positions.insert(entity, Position::new(x, y)).unwrap(); | |
map.tiles.insert((x, y), entity); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` | |
--> src/systems.rs:212:34 | |
| | |
212 | let entity = match map.tiles.get(&(x, y)) { | |
| __________________________________^ | |
213 | | Some(entity) => *entity, | |
214 | | None => { | |
215 | | let entity = entities.create(); | |
... | | |
219 | | } | |
220 | | }; | |
| |_____________________^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment