1
Fork 0

Rollup merge of #133530 - timvisee:master, r=jhpratt

Use consistent wording in docs, use is zero instead of is 0

In documentation, wording of _"`rhs` is zero"_ and _"`rhs` is 0"_ is intermixed. This is especially visible [here](https://doc.rust-lang.org/std/primitive.usize.html#method.div_ceil).

This changes all occurrences to _"`rhs` is zero"_ for better readability.
This commit is contained in:
Matthias Krüger 2024-11-29 10:18:58 +01:00 committed by GitHub
commit 8ca5a907a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 52 additions and 52 deletions

View file

@ -452,7 +452,7 @@ impl<T: Ord> BinaryHeap<T> {
/// ///
/// The binary heap will be able to hold at least `capacity` elements without /// The binary heap will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the binary heap will not allocate. /// `capacity`. If `capacity` is zero, the binary heap will not allocate.
/// ///
/// # Examples /// # Examples
/// ///
@ -496,7 +496,7 @@ impl<T: Ord, A: Allocator> BinaryHeap<T, A> {
/// ///
/// The binary heap will be able to hold at least `capacity` elements without /// The binary heap will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the binary heap will not allocate. /// `capacity`. If `capacity` is zero, the binary heap will not allocate.
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -427,7 +427,7 @@ impl<T> Vec<T> {
/// ///
/// The vector will be able to hold at least `capacity` elements without /// The vector will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the vector will not allocate. /// `capacity`. If `capacity` is zero, the vector will not allocate.
/// ///
/// It is important to note that although the returned vector has the /// It is important to note that although the returned vector has the
/// minimum *capacity* specified, the vector will have a zero *length*. For /// minimum *capacity* specified, the vector will have a zero *length*. For
@ -487,7 +487,7 @@ impl<T> Vec<T> {
/// ///
/// The vector will be able to hold at least `capacity` elements without /// The vector will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the vector will not allocate. /// `capacity`. If `capacity` is zero, the vector will not allocate.
/// ///
/// # Errors /// # Errors
/// ///
@ -745,7 +745,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// ///
/// The vector will be able to hold at least `capacity` elements without /// The vector will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the vector will not allocate. /// `capacity`. If `capacity` is zero, the vector will not allocate.
/// ///
/// It is important to note that although the returned vector has the /// It is important to note that although the returned vector has the
/// minimum *capacity* specified, the vector will have a zero *length*. For /// minimum *capacity* specified, the vector will have a zero *length*. For
@ -808,7 +808,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// ///
/// The vector will be able to hold at least `capacity` elements without /// The vector will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the vector will not allocate. /// `capacity`. If `capacity` is zero, the vector will not allocate.
/// ///
/// # Errors /// # Errors
/// ///

View file

@ -1553,7 +1553,7 @@ pub trait Iterator {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a /// Panics if `N` is zero. This check will most probably get changed to a
/// compile time error before this method gets stabilized. /// compile time error before this method gets stabilized.
/// ///
/// ```should_panic /// ```should_panic
@ -3454,7 +3454,7 @@ pub trait Iterator {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. /// Panics if `N` is zero.
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -1828,7 +1828,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1986,7 +1986,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2014,7 +2014,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2042,7 +2042,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2069,7 +2069,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2526,7 +2526,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2557,7 +2557,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2588,7 +2588,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2619,7 +2619,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2887,7 +2887,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0 or if `self` is `Self::MIN` /// This function will panic if `rhs` is zero or if `self` is `Self::MIN`
/// and `rhs` is -1. This behavior is not affected by the `overflow-checks` flag. /// and `rhs` is -1. This behavior is not affected by the `overflow-checks` flag.
/// ///
/// # Examples /// # Examples
@ -2926,7 +2926,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0 or if `self` is `Self::MIN` and /// This function will panic if `rhs` is zero or if `self` is `Self::MIN` and
/// `rhs` is -1. This behavior is not affected by the `overflow-checks` flag. /// `rhs` is -1. This behavior is not affected by the `overflow-checks` flag.
/// ///
/// # Examples /// # Examples
@ -2975,7 +2975,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0 or if `self` is `Self::MIN` /// This function will panic if `rhs` is zero or if `self` is `Self::MIN`
/// and `rhs` is -1. This behavior is not affected by the `overflow-checks` flag. /// and `rhs` is -1. This behavior is not affected by the `overflow-checks` flag.
/// ///
/// # Examples /// # Examples
@ -3019,7 +3019,7 @@ macro_rules! int_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0 or if `self` is `Self::MIN` /// This function will panic if `rhs` is zero or if `self` is `Self::MIN`
/// and `rhs` is -1. This behavior is not affected by the `overflow-checks` flag. /// and `rhs` is -1. This behavior is not affected by the `overflow-checks` flag.
/// ///
/// # Examples /// # Examples

View file

@ -1877,7 +1877,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2034,7 +2034,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2063,7 +2063,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2091,7 +2091,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2121,7 +2121,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2545,7 +2545,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2576,7 +2576,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2604,7 +2604,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2635,7 +2635,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2872,7 +2872,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -2900,7 +2900,7 @@ macro_rules! uint_impl {
/// ///
/// # Panics /// # Panics
/// ///
/// This function will panic if `rhs` is 0. /// This function will panic if `rhs` is zero.
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -1077,7 +1077,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `size` is 0. /// Panics if `size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1133,7 +1133,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1168,7 +1168,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1210,7 +1210,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1249,7 +1249,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1326,7 +1326,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1372,7 +1372,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1410,7 +1410,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1486,7 +1486,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1527,7 +1527,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1571,7 +1571,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1606,7 +1606,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `N` is 0. This check will most probably get changed to a compile time /// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized. /// error before this method gets stabilized.
/// ///
/// # Examples /// # Examples
@ -1642,7 +1642,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1677,7 +1677,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1720,7 +1720,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///
@ -1760,7 +1760,7 @@ impl<T> [T] {
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if `chunk_size` is 0. /// Panics if `chunk_size` is zero.
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -235,7 +235,7 @@ impl<K, V> HashMap<K, V, RandomState> {
/// ///
/// The hash map will be able to hold at least `capacity` elements without /// The hash map will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the hash map will not allocate. /// `capacity`. If `capacity` is zero, the hash map will not allocate.
/// ///
/// # Examples /// # Examples
/// ///
@ -287,7 +287,7 @@ impl<K, V, S> HashMap<K, V, S> {
/// ///
/// The hash map will be able to hold at least `capacity` elements without /// The hash map will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the hash map will not allocate. /// `capacity`. If `capacity` is zero, the hash map will not allocate.
/// ///
/// Warning: `hasher` is normally randomly generated, and /// Warning: `hasher` is normally randomly generated, and
/// is designed to allow HashMaps to be resistant to attacks that /// is designed to allow HashMaps to be resistant to attacks that

View file

@ -130,7 +130,7 @@ impl<T> HashSet<T, RandomState> {
/// ///
/// The hash set will be able to hold at least `capacity` elements without /// The hash set will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the hash set will not allocate. /// `capacity`. If `capacity` is zero, the hash set will not allocate.
/// ///
/// # Examples /// # Examples
/// ///
@ -379,7 +379,7 @@ impl<T, S> HashSet<T, S> {
/// ///
/// The hash set will be able to hold at least `capacity` elements without /// The hash set will be able to hold at least `capacity` elements without
/// reallocating. This method is allowed to allocate for more elements than /// reallocating. This method is allowed to allocate for more elements than
/// `capacity`. If `capacity` is 0, the hash set will not allocate. /// `capacity`. If `capacity` is zero, the hash set will not allocate.
/// ///
/// Warning: `hasher` is normally randomly generated, and /// Warning: `hasher` is normally randomly generated, and
/// is designed to allow `HashSet`s to be resistant to attacks that /// is designed to allow `HashSet`s to be resistant to attacks that