feat(interface-types) Use Vec::last_mut to simplify code.

This commit is contained in:
Ivan Enderlin 2020-04-03 16:20:22 +02:00
parent 3426921a8b
commit d184ddbe37

View File

@ -79,9 +79,7 @@ impl Serializer {
}
fn last(&mut self) -> &mut Vec<InterfaceValue> {
let index = self.values.len() - 1;
&mut self.values[index]
self.values.last_mut().unwrap()
}
fn push_with_capacity(&mut self, capacity: usize) {