(
&mut self,
branch: &Branch,
_after: Option<BranchId>,
)
| 554 | } |
| 555 | |
| 556 | fn put_branch( |
| 557 | &mut self, |
| 558 | branch: &Branch, |
| 559 | _after: Option<BranchId>, |
| 560 | ) -> Result<bool, Self::Error> { |
| 561 | let is_new = !self.branches.contains_key(&branch.id()); |
| 562 | self.branches.insert(branch.id(), branch.clone()); |
| 563 | self.trunk_branches |
| 564 | .entry(branch.trunk()) |
| 565 | .or_default() |
| 566 | .push(branch.id()); |
| 567 | Ok(is_new) |
| 568 | } |
| 569 | |
| 570 | fn get_branch(&self, id: BranchId) -> Result<Option<Branch>, Self::Error> { |
| 571 | Ok(self.branches.get(&id).cloned()) |