Skip to content

Commit 1730343

Browse files
committed
Fix typos “an”→“a” and a few different ones that appeared in the same search
1 parent 30cc0a5 commit 1730343

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

alloc/src/collections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
//! }
4747
//! }
4848
//!
49-
//! // Each node is represented as an `usize`, for a shorter implementation.
49+
//! // Each node is represented as a `usize`, for a shorter implementation.
5050
//! struct Edge {
5151
//! node: usize,
5252
//! cost: usize,

core/src/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ extern "rust-intrinsic" {
10131013
/// let val_casts = unsafe { &mut *(ptr as *mut i32 as *mut u32) };
10141014
/// ```
10151015
///
1016-
/// Turning an `&str` into an `&[u8]`:
1016+
/// Turning an `&str` into a `&[u8]`:
10171017
///
10181018
/// ```
10191019
/// // this is not a good way to do this.

core/src/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ pub unsafe fn zeroed<T>() -> T {
660660
#[rustc_diagnostic_item = "mem_uninitialized"]
661661
#[track_caller]
662662
pub unsafe fn uninitialized<T>() -> T {
663-
// SAFETY: the caller must guarantee that an unitialized value is valid for `T`.
663+
// SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
664664
unsafe {
665665
intrinsics::assert_uninit_valid::<T>();
666666
MaybeUninit::uninit().assume_init()

core/src/ptr/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
767767
///
768768
/// # Examples
769769
///
770-
/// Read an usize value from a byte buffer:
770+
/// Read a usize value from a byte buffer:
771771
///
772772
/// ```
773773
/// use std::mem;
@@ -960,7 +960,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
960960
///
961961
/// # Examples
962962
///
963-
/// Write an usize value to a byte buffer:
963+
/// Write a usize value to a byte buffer:
964964
///
965965
/// ```
966966
/// use std::mem;
@@ -1232,7 +1232,7 @@ pub(crate) unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
12321232
let smoda = stride & a_minus_one;
12331233
// SAFETY: a is power-of-two hence non-zero. stride == 0 case is handled above.
12341234
let gcdpow = unsafe { intrinsics::cttz_nonzero(stride).min(intrinsics::cttz_nonzero(a)) };
1235-
// SAFETY: gcdpow has an upper-bound that’s at most the number of bits in an usize.
1235+
// SAFETY: gcdpow has an upper-bound that’s at most the number of bits in a usize.
12361236
let gcd = unsafe { unchecked_shl(1usize, gcdpow) };
12371237

12381238
// SAFETY: gcd is always greater or equal to 1.

std/src/ffi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
//!
9595
//! * [`OsStr`] represents a borrowed reference to a string in a
9696
//! format that can be passed to the operating system. It can be
97-
//! converted into an UTF-8 Rust string slice in a similar way to
97+
//! converted into a UTF-8 Rust string slice in a similar way to
9898
//! [`OsString`].
9999
//!
100100
//! # Conversions

std/src/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ impl<'a> DerefMut for IoSliceMut<'a> {
11501150

11511151
/// A buffer type used with `Write::write_vectored`.
11521152
///
1153-
/// It is semantically a wrapper around an `&[u8]`, but is guaranteed to be
1153+
/// It is semantically a wrapper around a `&[u8]`, but is guaranteed to be
11541154
/// ABI compatible with the `iovec` type on Unix platforms and `WSABUF` on
11551155
/// Windows.
11561156
#[stable(feature = "iovec", since = "1.36.0")]

std/src/keyword_docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ mod dyn_keyword {}
22892289
/// }
22902290
///
22912291
/// let mut u = IntOrFloat { f: 1.0 };
2292-
/// // Reading the fields of an union is always unsafe
2292+
/// // Reading the fields of a union is always unsafe
22932293
/// assert_eq!(unsafe { u.i }, 1065353216);
22942294
/// // Updating through any of the field will modify all of them
22952295
/// u.i = 1073741824;

std/src/sys/windows/stdio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl io::Read for Stdin {
162162
}
163163

164164
let mut utf16_buf = [0u16; MAX_BUFFER_SIZE / 2];
165-
// In the worst case, an UTF-8 string can take 3 bytes for every `u16` of an UTF-16. So
165+
// In the worst case, a UTF-8 string can take 3 bytes for every `u16` of a UTF-16. So
166166
// we can read at most a third of `buf.len()` chars and uphold the guarantee no data gets
167167
// lost.
168168
let amount = cmp::min(buf.len() / 3, utf16_buf.len());

std/src/sys_common/wtf8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ pub fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool {
785785
/// Copied from core::str::raw::slice_unchecked
786786
#[inline]
787787
pub unsafe fn slice_unchecked(s: &Wtf8, begin: usize, end: usize) -> &Wtf8 {
788-
// memory layout of an &[u8] and &Wtf8 are the same
788+
// memory layout of a &[u8] and &Wtf8 are the same
789789
Wtf8::from_bytes_unchecked(slice::from_raw_parts(s.bytes.as_ptr().add(begin), end - begin))
790790
}
791791

std/src/time/monotonic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub mod inner {
8484
pub(super) fn monotonize(raw: time::Instant) -> time::Instant {
8585
let delta = raw.checked_sub_instant(&ZERO).unwrap();
8686
// Split into seconds and nanos since Duration doesn't have a
87-
// constructor that takes an u128
87+
// constructor that takes a u128
8888
let secs = delta.as_secs() as u128;
8989
let nanos = delta.subsec_nanos() as u128;
9090
let timestamp: u128 = secs << 64 | nanos;

0 commit comments

Comments
 (0)