rust-utils: remove buggy assertion
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 17 Jul 2019 18:15:51 +0200
changeset 42611 2f760da140ee
parent 42610 5672bb73f61e
child 42612 3c16b9c0b099
rust-utils: remove buggy assertion While this assertion had good intentions, it broke existing behavior with a nasty panic. Differential Revision: https://phab.mercurial-scm.org/D6651
rust/hg-core/src/utils.rs
--- a/rust/hg-core/src/utils.rs	Wed Jul 10 17:41:07 2019 +0200
+++ b/rust/hg-core/src/utils.rs	Wed Jul 17 18:15:51 2019 +0200
@@ -18,8 +18,7 @@
 where
     T: Clone + PartialEq,
 {
-    assert_eq!(from.len(), to.len());
-    if buf.len() < from.len() {
+    if buf.len() < from.len() || from.len() != to.len() {
         return;
     }
     for i in 0..=buf.len() - from.len() {