Skip to content

Instantly share code, notes, and snippets.

@xla
Last active March 6, 2019 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xla/4475090ad1dd00d82f216e302630268d to your computer and use it in GitHub Desktop.
Save xla/4475090ad1dd00d82f216e302630268d to your computer and use it in GitHub Desktop.
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);
}
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