D6651: rust-utils: remove buggy assertion

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Wed Jul 17 19:04:59 EDT 2019


Closed by commit rHGa6a272c4ebf9: rust-utils: remove buggy assertion (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6651?vs=15930&id=15940

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6651/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6651

AFFECTED FILES
  rust/hg-core/src/utils.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/utils.rs b/rust/hg-core/src/utils.rs
--- a/rust/hg-core/src/utils.rs
+++ b/rust/hg-core/src/utils.rs
@@ -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() {



To: Alphare, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list