Fix typos “a”→“an”

This commit is contained in:
Frank Steffahn
2021-08-22 14:46:15 +02:00
parent 2ad56d5c90
commit bf88b113ea
99 changed files with 157 additions and 157 deletions

View File

@@ -321,7 +321,7 @@ pub unsafe trait IntoErasedSendSync<'a> {
/////////////////////////////////////////////////////////////////////////////
impl<O, T: ?Sized> OwningRef<O, T> {
/// Creates a new owning reference from a owner
/// Creates a new owning reference from an owner
/// initialized to the direct dereference of it.
///
/// # Example
@@ -368,7 +368,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// fn main() {
/// let owning_ref = OwningRef::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref.map(|array| &array[2]);
/// assert_eq!(*owning_ref, 3);
@@ -396,7 +396,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// fn main() {
/// let owning_ref = OwningRef::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref.try_map(|array| {
/// if array[2] == 3 { Ok(&array[2]) } else { Err(()) }
@@ -430,7 +430,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// in an additional `Box<O>`.
///
/// This can be used to safely erase the owner of any `OwningRef<O, T>`
/// to a `OwningRef<Box<Erased>, T>`.
/// to an `OwningRef<Box<Erased>, T>`.
pub fn map_owner_box(self) -> OwningRef<Box<O>, T> {
OwningRef { reference: self.reference, owner: Box::new(self.owner) }
}
@@ -511,7 +511,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
}
impl<O, T: ?Sized> OwningRefMut<O, T> {
/// Creates a new owning reference from a owner
/// Creates a new owning reference from an owner
/// initialized to the direct dereference of it.
///
/// # Example
@@ -558,7 +558,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref_mut.map(|array| &array[2]);
/// assert_eq!(*owning_ref, 3);
@@ -586,7 +586,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref_mut = owning_ref_mut.map_mut(|array| &mut array[2]);
/// assert_eq!(*owning_ref_mut, 3);
@@ -614,7 +614,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref_mut.try_map(|array| {
/// if array[2] == 3 { Ok(&array[2]) } else { Err(()) }
@@ -644,7 +644,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref_mut = owning_ref_mut.try_map_mut(|array| {
/// if array[2] == 3 { Ok(&mut array[2]) } else { Err(()) }
@@ -678,7 +678,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// in an additional `Box<O>`.
///
/// This can be used to safely erase the owner of any `OwningRefMut<O, T>`
/// to a `OwningRefMut<Box<Erased>, T>`.
/// to an `OwningRefMut<Box<Erased>, T>`.
pub fn map_owner_box(self) -> OwningRefMut<Box<O>, T> {
OwningRefMut { reference: self.reference, owner: Box::new(self.owner) }
}
@@ -970,7 +970,7 @@ where
}
}
// ^ FIXME: Is a Into impl for calling into_inner() possible as well?
// ^ FIXME: Is an Into impl for calling into_inner() possible as well?
impl<O, T: ?Sized> Debug for OwningRef<O, T>
where
@@ -1139,27 +1139,27 @@ impl<T: 'static> ToHandleMut for RefCell<T> {
// about which handle creation to use (i.e., read() vs try_read()) as well as
// what to do with error results.
/// Typedef of a owning reference that uses a `Box` as the owner.
/// Typedef of an owning reference that uses a `Box` as the owner.
pub type BoxRef<T, U = T> = OwningRef<Box<T>, U>;
/// Typedef of a owning reference that uses a `Vec` as the owner.
/// Typedef of an owning reference that uses a `Vec` as the owner.
pub type VecRef<T, U = T> = OwningRef<Vec<T>, U>;
/// Typedef of a owning reference that uses a `String` as the owner.
/// Typedef of an owning reference that uses a `String` as the owner.
pub type StringRef = OwningRef<String, str>;
/// Typedef of a owning reference that uses a `Rc` as the owner.
/// Typedef of an owning reference that uses a `Rc` as the owner.
pub type RcRef<T, U = T> = OwningRef<Rc<T>, U>;
/// Typedef of a owning reference that uses a `Arc` as the owner.
/// Typedef of an owning reference that uses a `Arc` as the owner.
pub type ArcRef<T, U = T> = OwningRef<Arc<T>, U>;
/// Typedef of a owning reference that uses a `Ref` as the owner.
/// Typedef of an owning reference that uses a `Ref` as the owner.
pub type RefRef<'a, T, U = T> = OwningRef<Ref<'a, T>, U>;
/// Typedef of a owning reference that uses a `RefMut` as the owner.
/// Typedef of an owning reference that uses a `RefMut` as the owner.
pub type RefMutRef<'a, T, U = T> = OwningRef<RefMut<'a, T>, U>;
/// Typedef of a owning reference that uses a `MutexGuard` as the owner.
/// Typedef of an owning reference that uses a `MutexGuard` as the owner.
pub type MutexGuardRef<'a, T, U = T> = OwningRef<MutexGuard<'a, T>, U>;
/// Typedef of a owning reference that uses a `RwLockReadGuard` as the owner.
/// Typedef of an owning reference that uses a `RwLockReadGuard` as the owner.
pub type RwLockReadGuardRef<'a, T, U = T> = OwningRef<RwLockReadGuard<'a, T>, U>;
/// Typedef of a owning reference that uses a `RwLockWriteGuard` as the owner.
/// Typedef of an owning reference that uses a `RwLockWriteGuard` as the owner.
pub type RwLockWriteGuardRef<'a, T, U = T> = OwningRef<RwLockWriteGuard<'a, T>, U>;
/// Typedef of a mutable owning reference that uses a `Box` as the owner.
@@ -1219,11 +1219,11 @@ unsafe impl<'a, T: Send + Sync + 'a> IntoErasedSendSync<'a> for Arc<T> {
}
}
/// Typedef of a owning reference that uses an erased `Box` as the owner.
/// Typedef of an owning reference that uses an erased `Box` as the owner.
pub type ErasedBoxRef<U> = OwningRef<Box<dyn Erased>, U>;
/// Typedef of a owning reference that uses an erased `Rc` as the owner.
/// Typedef of an owning reference that uses an erased `Rc` as the owner.
pub type ErasedRcRef<U> = OwningRef<Rc<dyn Erased>, U>;
/// Typedef of a owning reference that uses an erased `Arc` as the owner.
/// Typedef of an owning reference that uses an erased `Arc` as the owner.
pub type ErasedArcRef<U> = OwningRef<Arc<dyn Erased>, U>;
/// Typedef of a mutable owning reference that uses an erased `Box` as the owner.

View File

@@ -220,7 +220,7 @@ impl SelfProfilerRef {
VerboseTimingGuard::start(message, self.generic_activity(event_label))
}
/// Start profiling a extra verbose generic activity. Profiling continues until the
/// Start profiling an extra verbose generic activity. Profiling continues until the
/// VerboseTimingGuard returned from this call is dropped. In addition to recording
/// a measureme event, "extra verbose" generic activities also print a timing entry to
/// stdout if the compiler is invoked with -Ztime-passes.

View File

@@ -14,7 +14,7 @@
//!
//! `MTRef` is an immutable reference if cfg!(parallel_compiler), and a mutable reference otherwise.
//!
//! `rustc_erase_owner!` erases a OwningRef owner into Erased or Erased + Send + Sync
//! `rustc_erase_owner!` erases an OwningRef owner into Erased or Erased + Send + Sync
//! depending on the value of cfg!(parallel_compiler).
use crate::owning_ref::{Erased, OwningRef};

View File

@@ -5,7 +5,7 @@
//!
//! - If you have a list that rarely stores more than one element, then this
//! data-structure can store the element without allocating and only uses as
//! much space as a `Option<(T, usize)>`. If T can double as the `Option`
//! much space as an `Option<(T, usize)>`. If T can double as the `Option`
//! discriminant, it will even only be as large as `T, usize`.
//!
//! If you expect to store more than 1 element in the common case, steer clear