(&mut self, id: TrunkId, new_path: &str)
| 107 | } |
| 108 | |
| 109 | fn update_trunk_path(&mut self, id: TrunkId, new_path: &str) -> Result<(), Self::Error> { |
| 110 | if let Some(trunk) = self.trunks.get_mut(&id) { |
| 111 | self.path_index.remove(trunk.path()); |
| 112 | trunk.set_path(new_path.to_string()); |
| 113 | self.path_index.insert(new_path.to_string(), id); |
| 114 | } |
| 115 | Ok(()) |
| 116 | } |
| 117 | |
| 118 | fn get_trunk_by_path(&self, path: &str) -> Result<Option<TrunkId>, Self::Error> { |
| 119 | Ok(self.path_index.get(path).copied()) |