Repository: tokio-rs/tokio
File: tokio/src/io/stderr.rs (Rust)

Code before:
    ///
    /// #[tokio::main]
    /// async fn main() -> io::Result<()> {
    ///     let mut stderr = io::stderr();
    ///     stderr.write_all(b"Print some error here.").await?;
    ///     Ok(())
    /// }
    /// ```
    #[derive(Debug)]
    pub struct Stderr {
        std: SplitByUtf8BoundaryIfWindows<Blocking<std::io::Stderr>>,
    }

    /// Constructs a new handle to the standard error of the current process.
    ///
    /// The returned handle allows writing to standard error from the within the
    /// Tokio runtime.
    ///
    /// Concurrent writes to stderr must be executed with care: Only individual
    /// writes to this [`AsyncWrite`] are guaranteed to be intact. In particular
    /// you should be aware that writes using [`write_all`] are not guaranteed
    /// to occur as a single write, so multiple threads writing data with
    /// [`write_all`] may result in interleaved output.
    ///
    /// Note that unlike [`std::io::stderr`], each call to this `stderr()`
    /// produces a new writer, so for example, this program does not flush stderr:
    ///
    /// ```no_run
    /// # use tokio::io::AsyncWriteExt;
    /// # #[tokio::main]
    /// # async fn main() -> std::io::Result<()> {
    /// tokio::io::stderr().write_all(b"aa").await?;
    /// tokio::io::stderr().flush().await?;
    /// # Ok(())
    /// # }
    /// ```
    ///
    /// [`std::io::stderr`]: std::io::stderr
    /// [`AsyncWrite`]: AsyncWrite
    /// [`write_all`]: crate::io::AsyncWriteExt::write_all()
    ///
    /// # Examples
    ///
    /// ```
    /// use tokio::io::{self, AsyncWriteExt};
    ///
    /// #[tokio::main]
    /// async fn main() -> io::Result<()> {
    ///     let mut stderr = io::stderr();
    ///     stderr.write_all(b"Print some error here.").await?;
    ///     Ok(())

Review comment (suggestion):
```suggestion
    /// produces a new writer, so for example, this program does **not** flush stderr:
```

Code after:
    ///
    /// #[tokio::main]
    /// async fn main() -> io::Result<()> {
    ///     let mut stderr = io::stderr();
    ///     stderr.write_all(b"Print some error here.").await?;
    ///     Ok(())
    /// }
    /// ```
    #[derive(Debug)]
    pub struct Stderr {
        std: SplitByUtf8BoundaryIfWindows<Blocking<std::io::Stderr>>,
    }

    /// Constructs a new handle to the standard error of the current process.
    ///
    /// The returned handle allows writing to standard error from the within the
    /// Tokio runtime.
    ///
    /// Concurrent writes to stderr must be executed with care: Only individual
    /// writes to this [`AsyncWrite`] are guaranteed to be intact. In particular
    /// you should be aware that writes using [`write_all`] are not guaranteed
    /// to occur as a single write, so multiple threads writing data with
    /// [`write_all`] may result in interleaved output.
    ///
    /// Note that unlike [`std::io::stderr`], each call to this `stderr()`
    /// produces a new writer, so for example, this program does **not** flush stderr:
    ///
    /// ```no_run
    /// # use tokio::io::AsyncWriteExt;
    /// # #[tokio::main]
    /// # async fn main() -> std::io::Result<()> {
    /// tokio::io::stderr().write_all(b"aa").await?;
    /// tokio::io::stderr().flush().await?;
    /// # Ok(())
    /// # }
    /// ```
    ///
    /// [`std::io::stderr`]: std::io::stderr
    /// [`AsyncWrite`]: AsyncWrite
    /// [`write_all`]: crate::io::AsyncWriteExt::write_all()
    ///
    /// # Examples
    ///
    /// ```
    /// use tokio::io::{self, AsyncWriteExt};
    ///
    /// #[tokio::main]
    /// async fn main() -> io::Result<()> {
    ///     let mut stderr = io::stderr();
    ///     stderr.write_all(b"Print some error here.").await?;
    ///     Ok(())