diff options
Diffstat (limited to 'library/std/src/sync')
| -rw-r--r-- | library/std/src/sync/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sync/mpsc/mod.rs | 20 | ||||
| -rw-r--r-- | library/std/src/sync/mpsc/shared.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sync/mutex/tests.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sync/poison.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sync/rwlock/tests.rs | 4 |
6 files changed, 17 insertions, 17 deletions
diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index ee35598bab5..87d01daeafc 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -19,7 +19,7 @@ //! B = 4; //! A = A + B; //! C = B; -//! println!("{} {} {}", A, B, C); +//! println!("{A} {B} {C}"); //! C = A; //! } //! } diff --git a/library/std/src/sync/mpsc/mod.rs b/library/std/src/sync/mpsc/mod.rs index 2e54321e127..e85a8723965 100644 --- a/library/std/src/sync/mpsc/mod.rs +++ b/library/std/src/sync/mpsc/mod.rs @@ -129,7 +129,7 @@ //! //! // Unbounded receiver waiting for all senders to complete. //! while let Ok(msg) = rx.recv() { -//! println!("{}", msg); +//! println!("{msg}"); //! } //! //! println!("completed"); @@ -376,7 +376,7 @@ impl<T> !Sync for Receiver<T> {} /// }); /// /// for x in recv.iter() { -/// println!("Got: {}", x); +/// println!("Got: {x}"); /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -419,7 +419,7 @@ pub struct Iter<'a, T: 'a> { /// thread::sleep(Duration::from_secs(2)); // block for two seconds /// /// for x in receiver.try_iter() { -/// println!("Got: {}", x); +/// println!("Got: {x}"); /// } /// ``` #[stable(feature = "receiver_try_iter", since = "1.15.0")] @@ -453,7 +453,7 @@ pub struct TryIter<'a, T: 'a> { /// }); /// /// for x in recv.into_iter() { -/// println!("Got: {}", x); +/// println!("Got: {x}"); /// } /// ``` #[stable(feature = "receiver_into_iter", since = "1.1.0")] @@ -544,16 +544,16 @@ impl<T> !Sync for Sender<T> {} /// let mut msg; /// /// msg = receiver.recv().unwrap(); -/// println!("message {} received", msg); +/// println!("message {msg} received"); /// /// // "Thread unblocked!" will be printed now /// /// msg = receiver.recv().unwrap(); -/// println!("message {} received", msg); +/// println!("message {msg} received"); /// /// msg = receiver.recv().unwrap(); /// -/// println!("message {} received", msg); +/// println!("message {msg} received"); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub struct SyncSender<T> { @@ -996,14 +996,14 @@ impl<T> SyncSender<T> { /// /// let mut msg; /// msg = receiver.recv().unwrap(); - /// println!("message {} received", msg); + /// println!("message {msg} received"); /// /// msg = receiver.recv().unwrap(); - /// println!("message {} received", msg); + /// println!("message {msg} received"); /// /// // Third message may have never been sent /// match receiver.try_recv() { - /// Ok(msg) => println!("message {} received", msg), + /// Ok(msg) => println!("message {msg} received"), /// Err(_) => println!("the third message was never sent"), /// } /// ``` diff --git a/library/std/src/sync/mpsc/shared.rs b/library/std/src/sync/mpsc/shared.rs index 8487a5f8b50..56162655544 100644 --- a/library/std/src/sync/mpsc/shared.rs +++ b/library/std/src/sync/mpsc/shared.rs @@ -369,7 +369,7 @@ impl<T> Packet<T> { match self.channels.fetch_sub(1, Ordering::SeqCst) { 1 => {} n if n > 1 => return, - n => panic!("bad number of channels left {}", n), + n => panic!("bad number of channels left {n}"), } match self.cnt.swap(DISCONNECTED, Ordering::SeqCst) { diff --git a/library/std/src/sync/mutex/tests.rs b/library/std/src/sync/mutex/tests.rs index a1b5aeddcb6..93900566f11 100644 --- a/library/std/src/sync/mutex/tests.rs +++ b/library/std/src/sync/mutex/tests.rs @@ -94,7 +94,7 @@ fn test_into_inner_poison() { assert!(m.is_poisoned()); match Arc::try_unwrap(m).unwrap().into_inner() { Err(e) => assert_eq!(e.into_inner(), NonCopy(10)), - Ok(x) => panic!("into_inner of poisoned Mutex is Ok: {:?}", x), + Ok(x) => panic!("into_inner of poisoned Mutex is Ok: {x:?}"), } } @@ -118,7 +118,7 @@ fn test_get_mut_poison() { assert!(m.is_poisoned()); match Arc::try_unwrap(m).unwrap().get_mut() { Err(e) => assert_eq!(*e.into_inner(), NonCopy(10)), - Ok(x) => panic!("get_mut of poisoned Mutex is Ok: {:?}", x), + Ok(x) => panic!("get_mut of poisoned Mutex is Ok: {x:?}"), } } diff --git a/library/std/src/sync/poison.rs b/library/std/src/sync/poison.rs index fa950331e64..07a90da449c 100644 --- a/library/std/src/sync/poison.rs +++ b/library/std/src/sync/poison.rs @@ -73,7 +73,7 @@ pub struct Guard { /// Ok(_) => unreachable!(), /// Err(p_err) => { /// let data = p_err.get_ref(); -/// println!("recovered: {}", data); +/// println!("recovered: {data}"); /// } /// }; /// ``` diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/rwlock/tests.rs index e9b74fb3ecc..53aa2b1e38a 100644 --- a/library/std/src/sync/rwlock/tests.rs +++ b/library/std/src/sync/rwlock/tests.rs @@ -218,7 +218,7 @@ fn test_into_inner_poison() { assert!(m.is_poisoned()); match Arc::try_unwrap(m).unwrap().into_inner() { Err(e) => assert_eq!(e.into_inner(), NonCopy(10)), - Ok(x) => panic!("into_inner of poisoned RwLock is Ok: {:?}", x), + Ok(x) => panic!("into_inner of poisoned RwLock is Ok: {x:?}"), } } @@ -242,6 +242,6 @@ fn test_get_mut_poison() { assert!(m.is_poisoned()); match Arc::try_unwrap(m).unwrap().get_mut() { Err(e) => assert_eq!(*e.into_inner(), NonCopy(10)), - Ok(x) => panic!("get_mut of poisoned RwLock is Ok: {:?}", x), + Ok(x) => panic!("get_mut of poisoned RwLock is Ok: {x:?}"), } } |
