| 274 | |
| 275 | impl ViewSyncConflict { |
| 276 | fn describe(&self) -> String { |
| 277 | match self { |
| 278 | ViewSyncConflict::Diverged { |
| 279 | first_mismatch, |
| 280 | local_len, |
| 281 | remote_len, |
| 282 | } => match first_mismatch { |
| 283 | Some(index) => format!( |
| 284 | "remote log ({remote_len} changes) is not a prefix of local log \ |
| 285 | ({local_len} changes): first mismatch at position {index}" |
| 286 | ), |
| 287 | None => format!( |
| 288 | "remote log ({remote_len} changes) is longer than local log \ |
| 289 | ({local_len} changes)" |
| 290 | ), |
| 291 | }, |
| 292 | ViewSyncConflict::IdentityMismatch { |
| 293 | field, |
| 294 | local, |
| 295 | remote, |
| 296 | } => { |
| 297 | format!("view {field} differs: local '{local}' vs remote '{remote}'") |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | fn plan_view_sync( |