mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-27 00:00:17 +02:00
Fix typos.
This commit is contained in:
committed by
Sean McArthur
parent
9b5e33d6f0
commit
e25b75a28e
+3
-3
@@ -16,7 +16,7 @@ macro_rules! buf_get_impl {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
if let Some(ret) = ret {
|
if let Some(ret) = ret {
|
||||||
// if the direct convertion was possible, advance and return
|
// if the direct conversion was possible, advance and return
|
||||||
$this.advance($size);
|
$this.advance($size);
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
@@ -792,7 +792,7 @@ pub trait Buf {
|
|||||||
/// Transforms a `Buf` into a concrete buffer.
|
/// Transforms a `Buf` into a concrete buffer.
|
||||||
///
|
///
|
||||||
/// `collect()` can operate on any value that implements `Buf`, and turn it
|
/// `collect()` can operate on any value that implements `Buf`, and turn it
|
||||||
/// into the relevent concrete buffer type.
|
/// into the relevant concrete buffer type.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@@ -997,6 +997,6 @@ impl Buf for Option<[u8; 1]> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The existance of this function makes the compiler catch if the Buf
|
// The existence of this function makes the compiler catch if the Buf
|
||||||
// trait is "object-safe" or not.
|
// trait is "object-safe" or not.
|
||||||
fn _assert_trait_object(_b: &dyn Buf) {}
|
fn _assert_trait_object(_b: &dyn Buf) {}
|
||||||
|
|||||||
+2
-2
@@ -942,7 +942,7 @@ pub trait BufMut {
|
|||||||
/// // Adapt reference to `std::io::Write`.
|
/// // Adapt reference to `std::io::Write`.
|
||||||
/// let mut writer = reference.writer();
|
/// let mut writer = reference.writer();
|
||||||
///
|
///
|
||||||
/// // Use the buffer as a writter
|
/// // Use the buffer as a writer
|
||||||
/// io::Write::write(&mut writer, &b"hello world"[..]).unwrap();
|
/// io::Write::write(&mut writer, &b"hello world"[..]).unwrap();
|
||||||
/// } // drop our &mut reference so that we can use `buf` again
|
/// } // drop our &mut reference so that we can use `buf` again
|
||||||
///
|
///
|
||||||
@@ -1069,6 +1069,6 @@ impl BufMut for Vec<u8> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The existance of this function makes the compiler catch if the BufMut
|
// The existence of this function makes the compiler catch if the BufMut
|
||||||
// trait is "object-safe" or not.
|
// trait is "object-safe" or not.
|
||||||
fn _assert_trait_object(_b: &dyn BufMut) {}
|
fn _assert_trait_object(_b: &dyn BufMut) {}
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ use std::io::{IoSlice, IoSliceMut};
|
|||||||
/// A `Chain` sequences two buffers.
|
/// A `Chain` sequences two buffers.
|
||||||
///
|
///
|
||||||
/// `Chain` is an adapter that links two underlying buffers and provides a
|
/// `Chain` is an adapter that links two underlying buffers and provides a
|
||||||
/// continous view across both buffers. It is able to sequence either immutable
|
/// continuous view across both buffers. It is able to sequence either immutable
|
||||||
/// buffers ([`Buf`] values) or mutable buffers ([`BufMut`] values).
|
/// buffers ([`Buf`] values) or mutable buffers ([`BufMut`] values).
|
||||||
///
|
///
|
||||||
/// This struct is generally created by calling [`Buf::chain`]. Please see that
|
/// This struct is generally created by calling [`Buf::chain`]. Please see that
|
||||||
|
|||||||
+2
-2
@@ -722,7 +722,7 @@ impl Bytes {
|
|||||||
///
|
///
|
||||||
/// This will only succeed if there are no other outstanding references to
|
/// This will only succeed if there are no other outstanding references to
|
||||||
/// the underlying chunk of memory. `Bytes` handles that contain inlined
|
/// the underlying chunk of memory. `Bytes` handles that contain inlined
|
||||||
/// bytes will always be convertable to `BytesMut`.
|
/// bytes will always be convertible to `BytesMut`.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@@ -2505,7 +2505,7 @@ impl Inner {
|
|||||||
// bits, so even without any explicit atomic operations, reading the
|
// bits, so even without any explicit atomic operations, reading the
|
||||||
// flag will be correct.
|
// flag will be correct.
|
||||||
//
|
//
|
||||||
// This is undefind behavior due to a data race, but experimental
|
// This is undefined behavior due to a data race, but experimental
|
||||||
// evidence shows that it works in practice (discussion:
|
// evidence shows that it works in practice (discussion:
|
||||||
// https://internals.rust-lang.org/t/bit-wise-reasoning-for-atomic-accesses/8853).
|
// https://internals.rust-lang.org/t/bit-wise-reasoning-for-atomic-accesses/8853).
|
||||||
//
|
//
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
//!
|
//!
|
||||||
//! # `Bytes`
|
//! # `Bytes`
|
||||||
//!
|
//!
|
||||||
//! `Bytes` is an efficient container for storing and operating on continguous
|
//! `Bytes` is an efficient container for storing and operating on contiguous
|
||||||
//! slices of memory. It is intended for use primarily in networking code, but
|
//! slices of memory. It is intended for use primarily in networking code, but
|
||||||
//! could have applications elsewhere as well.
|
//! could have applications elsewhere as well.
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ fn test_clone() {
|
|||||||
buf.write_str("this is a test").unwrap();
|
buf.write_str("this is a test").unwrap();
|
||||||
let buf2 = buf.clone();
|
let buf2 = buf.clone();
|
||||||
|
|
||||||
buf.write_str(" of our emergecy broadcast system").unwrap();
|
buf.write_str(" of our emergency broadcast system").unwrap();
|
||||||
assert!(buf != buf2);
|
assert!(buf != buf2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user