D10085: copies-rust: remove an unnecessary format!() inside assert!()
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Mon Mar 1 22:49:52 UTC 2021
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
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]
}
}
To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list