copies-rust: remove an unnecessary format!() inside assert!()
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 01 Mar 2021 14:44:29 -0800
changeset 46619 f2fc34e88238
parent 46618 dde86beca388
child 46620 7621ab4005bf
copies-rust: remove an unnecessary format!() inside assert!() 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. Differential Revision: https://phab.mercurial-scm.org/D10085
rust/hg-core/src/copy_tracing.rs
--- a/rust/hg-core/src/copy_tracing.rs	Mon Mar 01 20:08:26 2021 +0100
+++ b/rust/hg-core/src/copy_tracing.rs	Mon Mar 01 14:44:29 2021 -0800
@@ -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]
     }
 }