changeset 42611:2f760da140ee

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
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 17 Jul 2019 18:15:51 +0200
parents 5672bb73f61e
children 3c16b9c0b099
files rust/hg-core/src/utils.rs
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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() {