Patchwork D10085: copies-rust: remove an unnecessary format!() inside assert!()

login
register
mail settings
Submitter phabricator
Date March 1, 2021, 10:49 p.m.
Message ID <differential-rev-PHID-DREV-a5nddmir7ihcestbz65n-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48400/
State Superseded
Headers show

Comments

phabricator - March 1, 2021, 10:49 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The `assert!()` macro supports formatting. Rust 2021 no longer
  supports an unnecessary `format!()` inside it. I noticed because I
  recently update my Rust toolchain and `test-check-cargo-lock.t`
  started failing.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/copy_tracing.rs b/rust/hg-core/src/copy_tracing.rs
--- a/rust/hg-core/src/copy_tracing.rs
+++ b/rust/hg-core/src/copy_tracing.rs
@@ -357,7 +357,7 @@ 
     }
 
     fn untokenize(&self, token: PathToken) -> &HgPathBuf {
-        assert!(token < self.path.len(), format!("Unknown token: {}", token));
+        assert!(token < self.path.len(), "Unknown token: {}", token);
         &self.path[token]
     }
 }