Use captured identifiers in format strings.

This was stabilized in Rust 1.58.0: https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html
This commit is contained in:
Tim Kuehn
2022-01-13 14:59:16 -08:00
parent 92cfe63c4f
commit b5d1828308
11 changed files with 24 additions and 24 deletions

View File

@@ -40,7 +40,7 @@ impl World for HelloServer {
let sleep_time =
Duration::from_millis(Uniform::new_inclusive(1, 10).sample(&mut thread_rng()));
time::sleep(sleep_time).await;
format!("Hello, {}! You are connected from {}", name, self.0)
format!("Hello, {name}! You are connected from {}", self.0)
}
}