(&mut self, id: T)
| 37 | } |
| 38 | |
| 39 | pub fn occupy(&mut self, id: T) -> anyhow::Result<()> { |
| 40 | if self.allocated.insert(id) { |
| 41 | Ok(()) |
| 42 | } else { |
| 43 | bail!("id already occupied") |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | pub fn allocate(&mut self) -> Option<T> { |
| 48 | let mut id = self.start.clone(); |
no outgoing calls
no test coverage detected