Branch methods
(
&mut self,
branch: &Branch,
_after: Option<BranchId>,
)
| 548 | |
| 549 | // Branch methods |
| 550 | fn put_branch( |
| 551 | &mut self, |
| 552 | branch: &Branch, |
| 553 | _after: Option<BranchId>, |
| 554 | ) -> Result<bool, Self::Error> { |
| 555 | let is_new = !self.branches.contains_key(&branch.id()); |
| 556 | self.branches.insert(branch.id(), branch.clone()); |
| 557 | self.trunk_branches |
| 558 | .entry(branch.trunk()) |
| 559 | .or_default() |
| 560 | .push(branch.id()); |
| 561 | Ok(is_new) |
| 562 | } |
| 563 | |
| 564 | fn get_branch(&self, id: BranchId) -> Result<Option<Branch>, Self::Error> { |
| 565 | Ok(self.branches.get(&id).cloned()) |
no test coverage detected