1
Fork 0

Add #[must_use] to remaining std functions (O-Z)

This commit is contained in:
John Kugelman 2021-10-30 23:37:32 -04:00
parent e249ce6b23
commit a81d4b18ea
12 changed files with 57 additions and 2 deletions

View file

@ -61,6 +61,7 @@ impl WaitTimeoutResult {
/// }
/// }
/// ```
#[must_use]
#[stable(feature = "wait_timeout", since = "1.5.0")]
pub fn timed_out(&self) -> bool {
self.0

View file

@ -707,6 +707,7 @@ impl<T> UnsafeFlavor<T> for Receiver<T> {
/// // Let's see what that answer was
/// println!("{:?}", receiver.recv().unwrap());
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
let a = Arc::new(oneshot::Packet::new());
@ -755,6 +756,7 @@ pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
/// assert_eq!(receiver.recv().unwrap(), 1);
/// assert_eq!(receiver.recv().unwrap(), 2);
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn sync_channel<T>(bound: usize) -> (SyncSender<T>, Receiver<T>) {
let a = Arc::new(sync::Packet::new(bound));