Skip to content

Commit

Permalink
io: fix doc for write_i8 to use signed integers (tokio-rs#5040)
Browse files Browse the repository at this point in the history
  • Loading branch information
grydholt authored and dbischof90 committed Oct 1, 2022
1 parent 21f31cf commit 90f113d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tokio/src/io/util/async_write_ext.rs
Expand Up @@ -406,7 +406,7 @@ cfg_io_util! {
/// ```
fn write_u8(&mut self, n: u8) -> WriteU8;

/// Writes an unsigned 8-bit integer to the underlying writer.
/// Writes a signed 8-bit integer to the underlying writer.
///
/// Equivalent to:
///
Expand All @@ -425,7 +425,7 @@ cfg_io_util! {
///
/// # Examples
///
/// Write unsigned 8 bit integers to a `AsyncWrite`:
/// Write signed 8 bit integers to a `AsyncWrite`:
///
/// ```rust
/// use tokio::io::{self, AsyncWriteExt};
Expand All @@ -434,10 +434,10 @@ cfg_io_util! {
/// async fn main() -> io::Result<()> {
/// let mut writer = Vec::new();
///
/// writer.write_u8(2).await?;
/// writer.write_u8(5).await?;
/// writer.write_i8(-2).await?;
/// writer.write_i8(126).await?;
///
/// assert_eq!(writer, b"\x02\x05");
/// assert_eq!(writer, b"\xFE\x7E");
/// Ok(())
/// }
/// ```
Expand Down

0 comments on commit 90f113d

Please sign in to comment.