Skip to content

Commit 8d2bb93

Browse files
committed
Consistent spelling of "adapter" in the standard library
Change all occurrences of "(A|a)daptor" to "(A|a)dapter".
1 parent 87dc824 commit 8d2bb93

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

library/core/src/alloc/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ pub unsafe trait Allocator {
338338
Ok(new_ptr)
339339
}
340340

341-
/// Creates a "by reference" adaptor for this instance of `Allocator`.
341+
/// Creates a "by reference" adapter for this instance of `Allocator`.
342342
///
343-
/// The returned adaptor also implements `Allocator` and will simply borrow this.
343+
/// The returned adapter also implements `Allocator` and will simply borrow this.
344344
#[inline(always)]
345345
fn by_ref(&self) -> &Self
346346
where

library/core/src/iter/traits/iterator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ pub trait Iterator {
694694
/// more idiomatic to use a `for` loop, but `for_each` may be more legible
695695
/// when processing items at the end of longer iterator chains. In some
696696
/// cases `for_each` may also be faster than a loop, because it will use
697-
/// internal iteration on adaptors like `Chain`.
697+
/// internal iteration on adapters like `Chain`.
698698
///
699699
/// [`for`]: ../../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
700700
///
@@ -1293,7 +1293,7 @@ pub trait Iterator {
12931293
Take::new(self, n)
12941294
}
12951295

1296-
/// An iterator adaptor similar to [`fold`] that holds internal state and
1296+
/// An iterator adapter similar to [`fold`] that holds internal state and
12971297
/// produces a new iterator.
12981298
///
12991299
/// [`fold`]: Iterator::fold
@@ -1604,7 +1604,7 @@ pub trait Iterator {
16041604

16051605
/// Borrows an iterator, rather than consuming it.
16061606
///
1607-
/// This is useful to allow applying iterator adaptors while still
1607+
/// This is useful to allow applying iterator adapters while still
16081608
/// retaining ownership of the original iterator.
16091609
///
16101610
/// # Examples

library/core/tests/iter/adapters/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::cell::Cell;
2424

2525
/// An iterator that panics whenever `next` or next_back` is called
2626
/// after `None` has already been returned. This does not violate
27-
/// `Iterator`'s contract. Used to test that iterator adaptors don't
27+
/// `Iterator`'s contract. Used to test that iterator adapters don't
2828
/// poll their inner iterators after exhausting them.
2929
pub struct NonFused<I> {
3030
iter: I,

library/std/src/io/mod.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,9 @@ pub trait Read {
810810
default_read_exact(self, buf)
811811
}
812812

813-
/// Creates a "by reference" adaptor for this instance of `Read`.
813+
/// Creates a "by reference" adapter for this instance of `Read`.
814814
///
815-
/// The returned adaptor also implements `Read` and will simply borrow this
815+
/// The returned adapter also implements `Read` and will simply borrow this
816816
/// current reader.
817817
///
818818
/// # Examples
@@ -889,7 +889,7 @@ pub trait Read {
889889
Bytes { inner: self }
890890
}
891891

892-
/// Creates an adaptor which will chain this stream with another.
892+
/// Creates an adapter which will chain this stream with another.
893893
///
894894
/// The returned `Read` instance will first read all bytes from this object
895895
/// until EOF is encountered. Afterwards the output is equivalent to the
@@ -927,7 +927,7 @@ pub trait Read {
927927
Chain { first: self, second: next, done_first: false }
928928
}
929929

930-
/// Creates an adaptor which will read at most `limit` bytes from it.
930+
/// Creates an adapter which will read at most `limit` bytes from it.
931931
///
932932
/// This function returns a new instance of `Read` which will read at most
933933
/// `limit` bytes, after which it will always return EOF ([`Ok(0)`]). Any
@@ -1326,7 +1326,7 @@ impl Initializer {
13261326
/// * The [`write`] method will attempt to write some data into the object,
13271327
/// returning how many bytes were successfully written.
13281328
///
1329-
/// * The [`flush`] method is useful for adaptors and explicit buffers
1329+
/// * The [`flush`] method is useful for adapters and explicit buffers
13301330
/// themselves for ensuring that all buffered data has been pushed out to the
13311331
/// 'true sink'.
13321332
///
@@ -1646,12 +1646,12 @@ pub trait Write {
16461646
fn write_fmt(&mut self, fmt: fmt::Arguments<'_>) -> Result<()> {
16471647
// Create a shim which translates a Write to a fmt::Write and saves
16481648
// off I/O errors. instead of discarding them
1649-
struct Adaptor<'a, T: ?Sized + 'a> {
1649+
struct Adapter<'a, T: ?Sized + 'a> {
16501650
inner: &'a mut T,
16511651
error: Result<()>,
16521652
}
16531653

1654-
impl<T: Write + ?Sized> fmt::Write for Adaptor<'_, T> {
1654+
impl<T: Write + ?Sized> fmt::Write for Adapter<'_, T> {
16551655
fn write_str(&mut self, s: &str) -> fmt::Result {
16561656
match self.inner.write_all(s.as_bytes()) {
16571657
Ok(()) => Ok(()),
@@ -1663,7 +1663,7 @@ pub trait Write {
16631663
}
16641664
}
16651665

1666-
let mut output = Adaptor { inner: self, error: Ok(()) };
1666+
let mut output = Adapter { inner: self, error: Ok(()) };
16671667
match fmt::write(&mut output, fmt) {
16681668
Ok(()) => Ok(()),
16691669
Err(..) => {
@@ -1677,9 +1677,9 @@ pub trait Write {
16771677
}
16781678
}
16791679

1680-
/// Creates a "by reference" adaptor for this instance of `Write`.
1680+
/// Creates a "by reference" adapter for this instance of `Write`.
16811681
///
1682-
/// The returned adaptor also implements `Write` and will simply borrow this
1682+
/// The returned adapter also implements `Write` and will simply borrow this
16831683
/// current writer.
16841684
///
16851685
/// # Examples
@@ -2263,7 +2263,7 @@ pub trait BufRead: Read {
22632263
}
22642264
}
22652265

2266-
/// Adaptor to chain together two readers.
2266+
/// Adapter to chain together two readers.
22672267
///
22682268
/// This struct is generally created by calling [`chain`] on a reader.
22692269
/// Please see the documentation of [`chain`] for more details.
@@ -2414,7 +2414,7 @@ impl<T, U> SizeHint for Chain<T, U> {
24142414
}
24152415
}
24162416

2417-
/// Reader adaptor which limits the bytes read from an underlying reader.
2417+
/// Reader adapter which limits the bytes read from an underlying reader.
24182418
///
24192419
/// This struct is generally created by calling [`take`] on a reader.
24202420
/// Please see the documentation of [`take`] for more details.

0 commit comments

Comments
 (0)