Skip to content

Commit 0a7cf36

Browse files
committed
fix(mirror): replace catch-all match arm on MirrorStatus with exhaustive variants
The wildcard `_ => DatabaseStatus::Mirroring` in `make_mirror_descriptor` masked any future `MirrorStatus` variants added without updating this branch. Replacing it with the four concrete non-Promoted arms restores exhaustiveness — the compiler will now flag missed cases.
1 parent aeb12d7 commit 0a7cf36

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

nodedb/tests/mirror/helpers.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ pub fn make_mirror_descriptor(
5454
name: name.to_string(),
5555
status: match &status {
5656
MirrorStatus::Promoted => DatabaseStatus::Active,
57-
_ => DatabaseStatus::Mirroring,
57+
MirrorStatus::Bootstrapping { .. }
58+
| MirrorStatus::Following
59+
| MirrorStatus::Degraded { .. }
60+
| MirrorStatus::Disconnected => DatabaseStatus::Mirroring,
5861
},
5962
created_at_lsn: 0,
6063
quota_ref: 0,

0 commit comments

Comments
 (0)