Get a mutable reference to the item at the given handle.
(&mut self, handle: f64)
| 35 | |
| 36 | /// Get a mutable reference to the item at the given handle. |
| 37 | pub fn get_mut(&mut self, handle: f64) -> Option<&mut T> { |
| 38 | let idx = handle as usize; |
| 39 | if idx == 0 || idx > self.items.len() { |
| 40 | return None; |
| 41 | } |
| 42 | self.items[idx - 1].as_mut() |
| 43 | } |
| 44 | |
| 45 | /// Free the item at the given handle. |
| 46 | pub fn free(&mut self, handle: f64) -> Option<T> { |
no outgoing calls
no test coverage detected