rust: fix broken debug assertions
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 09 Jan 2023 18:00:56 +0100
changeset 49916 321e2b7bc95c
parent 49915 c8ef85ace216
child 49917 4c71c215bcfe
rust: fix broken debug assertions These were caught by `clippy`. It appears no one uses the debug builds, which is how this wasn't caught before.
rust/hg-core/src/copy_tracing.rs
--- a/rust/hg-core/src/copy_tracing.rs	Mon Jan 09 17:48:54 2023 +0100
+++ b/rust/hg-core/src/copy_tracing.rs	Mon Jan 09 18:00:56 2023 +0100
@@ -613,7 +613,7 @@
         // eventually.
         (MergePick::Minor, true)
     } else if src_major.path == src_minor.path {
-        debug_assert!(src_major.rev != src_major.rev);
+        debug_assert!(src_major.rev != src_minor.rev);
         // we have the same value, but from other source;
         if src_major.is_overwritten_by(src_minor) {
             (MergePick::Minor, false)
@@ -623,7 +623,7 @@
             (MergePick::Any, true)
         }
     } else {
-        debug_assert!(src_major.rev != src_major.rev);
+        debug_assert!(src_major.rev != src_minor.rev);
         let action = merge_case_for_dest();
         if src_minor.path.is_some()
             && src_major.path.is_none()