Add #[must_use] to remaining std functions (A-N)

This commit is contained in:
John Kugelman
2021-10-30 22:58:27 -04:00
parent e249ce6b23
commit e129d49f88
18 changed files with 68 additions and 14 deletions

View File

@@ -301,6 +301,7 @@ pub struct StdinLock<'a> {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stdin() -> Stdin {
static INSTANCE: SyncOnceCell<Mutex<BufReader<StdinRaw>>> = SyncOnceCell::new();
@@ -673,6 +674,7 @@ static STDOUT: SyncOnceCell<ReentrantMutex<RefCell<LineWriter<StdoutRaw>>>> = Sy
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stdout() -> Stdout {
Stdout {
@@ -953,6 +955,7 @@ pub struct StderrLock<'a> {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stderr() -> Stderr {
// Note that unlike `stdout()` we don't use `at_exit` here to register a