Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change doc for write_i8 so it uses signed integers #5040

Merged
merged 3 commits into from Sep 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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