diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs index 06a761531b6..1f1033b0437 100644 --- a/library/core/src/alloc/mod.rs +++ b/library/core/src/alloc/mod.rs @@ -338,9 +338,9 @@ unsafe fn shrink( Ok(new_ptr) } - /// Creates a "by reference" adaptor for this instance of `Allocator`. + /// Creates a "by reference" adapter for this instance of `Allocator`. /// - /// The returned adaptor also implements `Allocator` and will simply borrow this. + /// The returned adapter also implements `Allocator` and will simply borrow this. #[inline(always)] fn by_ref(&self) -> &Self where diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index f34adb878c4..537e42f66de 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -694,7 +694,7 @@ fn map(self, f: F) -> Map /// more idiomatic to use a `for` loop, but `for_each` may be more legible /// when processing items at the end of longer iterator chains. In some /// cases `for_each` may also be faster than a loop, because it will use - /// internal iteration on adaptors like `Chain`. + /// internal iteration on adapters like `Chain`. /// /// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for /// @@ -1293,7 +1293,7 @@ fn take(self, n: usize) -> Take Take::new(self, n) } - /// An iterator adaptor similar to [`fold`] that holds internal state and + /// An iterator adapter similar to [`fold`] that holds internal state and /// produces a new iterator. /// /// [`fold`]: Iterator::fold @@ -1604,7 +1604,7 @@ fn inspect(self, f: F) -> Inspect /// Borrows an iterator, rather than consuming it. /// - /// This is useful to allow applying iterator adaptors while still + /// This is useful to allow applying iterator adapters while still /// retaining ownership of the original iterator. /// /// # Examples diff --git a/library/core/tests/iter/adapters/mod.rs b/library/core/tests/iter/adapters/mod.rs index 96a53be1eaa..567d9fe49ca 100644 --- a/library/core/tests/iter/adapters/mod.rs +++ b/library/core/tests/iter/adapters/mod.rs @@ -24,7 +24,7 @@ /// An iterator that panics whenever `next` or next_back` is called /// after `None` has already been returned. This does not violate -/// `Iterator`'s contract. Used to test that iterator adaptors don't +/// `Iterator`'s contract. Used to test that iterator adapters don't /// poll their inner iterators after exhausting them. pub struct NonFused { iter: I, diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index b336b65ad7d..fa073d080c6 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -810,9 +810,9 @@ fn read_exact(&mut self, buf: &mut [u8]) -> Result<()> { default_read_exact(self, buf) } - /// Creates a "by reference" adaptor for this instance of `Read`. + /// Creates a "by reference" adapter for this instance of `Read`. /// - /// The returned adaptor also implements `Read` and will simply borrow this + /// The returned adapter also implements `Read` and will simply borrow this /// current reader. /// /// # Examples @@ -889,7 +889,7 @@ fn bytes(self) -> Bytes Bytes { inner: self } } - /// Creates an adaptor which will chain this stream with another. + /// Creates an adapter which will chain this stream with another. /// /// The returned `Read` instance will first read all bytes from this object /// until EOF is encountered. Afterwards the output is equivalent to the @@ -927,7 +927,7 @@ fn chain(self, next: R) -> Chain Chain { first: self, second: next, done_first: false } } - /// Creates an adaptor which will read at most `limit` bytes from it. + /// Creates an adapter which will read at most `limit` bytes from it. /// /// This function returns a new instance of `Read` which will read at most /// `limit` bytes, after which it will always return EOF ([`Ok(0)`]). Any @@ -1326,7 +1326,7 @@ pub fn initialize(&self, buf: &mut [u8]) { /// * The [`write`] method will attempt to write some data into the object, /// returning how many bytes were successfully written. /// -/// * The [`flush`] method is useful for adaptors and explicit buffers +/// * The [`flush`] method is useful for adapters and explicit buffers /// themselves for ensuring that all buffered data has been pushed out to the /// 'true sink'. /// @@ -1646,12 +1646,12 @@ fn write_all_vectored(&mut self, mut bufs: &mut [IoSlice<'_>]) -> Result<()> { fn write_fmt(&mut self, fmt: fmt::Arguments<'_>) -> Result<()> { // Create a shim which translates a Write to a fmt::Write and saves // off I/O errors. instead of discarding them - struct Adaptor<'a, T: ?Sized + 'a> { + struct Adapter<'a, T: ?Sized + 'a> { inner: &'a mut T, error: Result<()>, } - impl fmt::Write for Adaptor<'_, T> { + impl fmt::Write for Adapter<'_, T> { fn write_str(&mut self, s: &str) -> fmt::Result { match self.inner.write_all(s.as_bytes()) { Ok(()) => Ok(()), @@ -1663,7 +1663,7 @@ fn write_str(&mut self, s: &str) -> fmt::Result { } } - let mut output = Adaptor { inner: self, error: Ok(()) }; + let mut output = Adapter { inner: self, error: Ok(()) }; match fmt::write(&mut output, fmt) { Ok(()) => Ok(()), Err(..) => { @@ -1677,9 +1677,9 @@ fn write_str(&mut self, s: &str) -> fmt::Result { } } - /// Creates a "by reference" adaptor for this instance of `Write`. + /// Creates a "by reference" adapter for this instance of `Write`. /// - /// The returned adaptor also implements `Write` and will simply borrow this + /// The returned adapter also implements `Write` and will simply borrow this /// current writer. /// /// # Examples @@ -2263,7 +2263,7 @@ fn lines(self) -> Lines } } -/// Adaptor to chain together two readers. +/// Adapter to chain together two readers. /// /// This struct is generally created by calling [`chain`] on a reader. /// Please see the documentation of [`chain`] for more details. @@ -2414,7 +2414,7 @@ fn upper_bound(&self) -> Option { } } -/// Reader adaptor which limits the bytes read from an underlying reader. +/// Reader adapter which limits the bytes read from an underlying reader. /// /// This struct is generally created by calling [`take`] on a reader. /// Please see the documentation of [`take`] for more details.