| 439 | } |
| 440 | |
| 441 | fn conflict_next(&mut self, id: usize, changes: Option<&[Hash]>) -> Result<(), std::io::Error> { |
| 442 | let hash = changes.and_then(|c| c.first()); |
| 443 | |
| 444 | // Add hash to the existing conflict record |
| 445 | if let Some(h) = hash { |
| 446 | if let Some(conflict) = self |
| 447 | .conflicts |
| 448 | .iter_mut() |
| 449 | .rev() |
| 450 | .find(|c| c.id == Some(id as u32)) |
| 451 | { |
| 452 | conflict.changes.push(*h); |
| 453 | } |
| 454 | } |
| 455 | |
| 456 | self.write_marker(markers::SEPARATOR, id as u32, hash) |
| 457 | } |
| 458 | |
| 459 | fn end_conflict(&mut self, id: usize) -> Result<(), std::io::Error> { |
| 460 | self.write_marker(markers::END, id as u32, None) |