How do I ignore the return expression in the RemoveEntity(index)
arm of the match expression?
pub fn update(&self) {
while !self.operations.borrow_mut().is_empty() {
match self.operations.borrow_mut().pop().unwrap() {
AddEntity(entity) => self.entities.borrow_mut().push(entity.clone()),
RemoveEntity(index) => {self.entities.borrow_mut().remove(index); ()},
}
}
}
My approach using the curlies and returning the unit type works but it feels clunky. Is there a better way?