From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- .../book/listings/ch08-common-collections/listing-08-04/src/main.rs | 4 ++-- .../book/listings/ch08-common-collections/listing-08-06/src/main.rs | 2 +- .../book/listings/ch08-common-collections/listing-08-07/src/main.rs | 2 +- .../book/listings/ch08-common-collections/listing-08-16/src/main.rs | 2 +- .../listings/ch08-common-collections/no-listing-02-format/src/main.rs | 2 +- .../no-listing-03-iterate-over-hashmap/src/main.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/doc/book/listings/ch08-common-collections') diff --git a/src/doc/book/listings/ch08-common-collections/listing-08-04/src/main.rs b/src/doc/book/listings/ch08-common-collections/listing-08-04/src/main.rs index fa4e090d5..fca332de6 100644 --- a/src/doc/book/listings/ch08-common-collections/listing-08-04/src/main.rs +++ b/src/doc/book/listings/ch08-common-collections/listing-08-04/src/main.rs @@ -3,11 +3,11 @@ fn main() { let v = vec![1, 2, 3, 4, 5]; let third: &i32 = &v[2]; - println!("The third element is {}", third); + println!("The third element is {third}"); let third: Option<&i32> = v.get(2); match third { - Some(third) => println!("The third element is {}", third), + Some(third) => println!("The third element is {third}"), None => println!("There is no third element."), } // ANCHOR_END: here diff --git a/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs b/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs index 1b42274a6..653ac27b0 100644 --- a/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs +++ b/src/doc/book/listings/ch08-common-collections/listing-08-06/src/main.rs @@ -6,6 +6,6 @@ fn main() { v.push(6); - println!("The first element is: {}", first); + println!("The first element is: {first}"); // ANCHOR_END: here } diff --git a/src/doc/book/listings/ch08-common-collections/listing-08-07/src/main.rs b/src/doc/book/listings/ch08-common-collections/listing-08-07/src/main.rs index 38b97784b..aebf855a9 100644 --- a/src/doc/book/listings/ch08-common-collections/listing-08-07/src/main.rs +++ b/src/doc/book/listings/ch08-common-collections/listing-08-07/src/main.rs @@ -2,7 +2,7 @@ fn main() { // ANCHOR: here let v = vec![100, 32, 57]; for i in &v { - println!("{}", i); + println!("{i}"); } // ANCHOR_END: here } diff --git a/src/doc/book/listings/ch08-common-collections/listing-08-16/src/main.rs b/src/doc/book/listings/ch08-common-collections/listing-08-16/src/main.rs index 8938dc143..db57cddba 100644 --- a/src/doc/book/listings/ch08-common-collections/listing-08-16/src/main.rs +++ b/src/doc/book/listings/ch08-common-collections/listing-08-16/src/main.rs @@ -3,6 +3,6 @@ fn main() { let mut s1 = String::from("foo"); let s2 = "bar"; s1.push_str(s2); - println!("s2 is {}", s2); + println!("s2 is {s2}"); // ANCHOR_END: here } diff --git a/src/doc/book/listings/ch08-common-collections/no-listing-02-format/src/main.rs b/src/doc/book/listings/ch08-common-collections/no-listing-02-format/src/main.rs index 4a38e63d2..db408e2b7 100644 --- a/src/doc/book/listings/ch08-common-collections/no-listing-02-format/src/main.rs +++ b/src/doc/book/listings/ch08-common-collections/no-listing-02-format/src/main.rs @@ -4,6 +4,6 @@ fn main() { let s2 = String::from("tac"); let s3 = String::from("toe"); - let s = format!("{}-{}-{}", s1, s2, s3); + let s = format!("{s1}-{s2}-{s3}"); // ANCHOR_END: here } diff --git a/src/doc/book/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs b/src/doc/book/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs index 2e7dc02e6..bb13c86f1 100644 --- a/src/doc/book/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs +++ b/src/doc/book/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs @@ -8,7 +8,7 @@ fn main() { scores.insert(String::from("Yellow"), 50); for (key, value) in &scores { - println!("{}: {}", key, value); + println!("{key}: {value}"); } // ANCHOR_END: here } -- cgit v1.2.3