From 72a25d05bf1a4b155d74139ef700ff93af6d8e22 Mon Sep 17 00:00:00 2001 From: T-O-R-U-S Date: Sat, 12 Feb 2022 23:16:17 +0400 Subject: Use implicit capture syntax in format_args This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored). --- compiler/rustc_errors/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 217d3ec2c24..3641c38f9dc 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1087,12 +1087,12 @@ impl HandlerInner { let warnings = match self.deduplicated_warn_count { 0 => String::new(), 1 => "1 warning emitted".to_string(), - count => format!("{} warnings emitted", count), + count => format!("{count} warnings emitted"), }; let errors = match self.deduplicated_err_count { 0 => String::new(), 1 => "aborting due to previous error".to_string(), - count => format!("aborting due to {} previous errors", count), + count => format!("aborting due to {count} previous errors"), }; if self.treat_err_as_bug() { return; -- cgit 1.4.1-3-g733a5