mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/data/schematic.rs')
| -rw-r--r-- | src/data/schematic.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/data/schematic.rs b/src/data/schematic.rs index d2b8aec..5465498 100644 --- a/src/data/schematic.rs +++ b/src/data/schematic.rs @@ -42,18 +42,12 @@ impl<'l> Placement<'l> { /// gets the current state of this placement. you can cast it with `placement.block::get_state(placement.get_state()?)?` #[must_use] pub fn get_state(&self) -> Option<&State> { - match self.state { - None => None, - Some(ref b) => Some(b), - } + self.state.as_ref() } /// get mutable state. pub fn get_state_mut(&mut self) -> Option<&mut State> { - match self.state { - None => None, - Some(ref mut b) => Some(b), - } + self.state.as_mut() } /// draws this placement in particular |