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).
This commit is contained in:
@@ -120,7 +120,7 @@ impl Command {
|
||||
Err(ref e) if e.kind() == ErrorKind::Interrupted => {}
|
||||
Err(e) => {
|
||||
assert!(p.wait().is_ok(), "wait() should either return Ok or panic");
|
||||
panic!("the CLOEXEC pipe failed: {:?}", e)
|
||||
panic!("the CLOEXEC pipe failed: {e:?}")
|
||||
}
|
||||
Ok(..) => {
|
||||
// pipe I/O up to PIPE_BUF bytes should be atomic
|
||||
@@ -682,15 +682,15 @@ impl From<c_int> for ExitStatus {
|
||||
impl fmt::Display for ExitStatus {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if let Some(code) = self.code() {
|
||||
write!(f, "exit status: {}", code)
|
||||
write!(f, "exit status: {code}")
|
||||
} else if let Some(signal) = self.signal() {
|
||||
if self.core_dumped() {
|
||||
write!(f, "signal: {} (core dumped)", signal)
|
||||
write!(f, "signal: {signal} (core dumped)")
|
||||
} else {
|
||||
write!(f, "signal: {}", signal)
|
||||
write!(f, "signal: {signal}")
|
||||
}
|
||||
} else if let Some(signal) = self.stopped_signal() {
|
||||
write!(f, "stopped (not terminated) by signal: {}", signal)
|
||||
write!(f, "stopped (not terminated) by signal: {signal}")
|
||||
} else if self.continued() {
|
||||
write!(f, "continued (WIFCONTINUED)")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user