Skip to content

Commit 1ad070a

Browse files
authored
Rollup merge of #105748 - hakoerber:master, r=Dylan-DPC
doc: Fix a few small issues Hey, while reading through the (awesome) stdlib docs, I found a few minor typos. * A few typos around generic types (`;` vs `,`) * Use inline code formatting for code fragments * One instance of wrong wording
2 parents cc04e97 + 9671dd2 commit 1ad070a

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

library/alloc/src/collections/vec_deque/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
25412541
/// The deque is assumed to be partitioned according to the given predicate.
25422542
/// This means that all elements for which the predicate returns true are at the start of the deque
25432543
/// and all elements for which the predicate returns false are at the end.
2544-
/// For example, [7, 15, 3, 5, 4, 12, 6] is a partitioned under the predicate x % 2 != 0
2544+
/// For example, `[7, 15, 3, 5, 4, 12, 6]` is partitioned under the predicate `x % 2 != 0`
25452545
/// (all odd numbers are at the start, all even at the end).
25462546
///
25472547
/// If the deque is not partitioned, the returned result is unspecified and meaningless,

library/core/src/array/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ where
6969
/// if any element creation was unsuccessful.
7070
///
7171
/// The return type of this function depends on the return type of the closure.
72-
/// If you return `Result<T, E>` from the closure, you'll get a `Result<[T; N]; E>`.
72+
/// If you return `Result<T, E>` from the closure, you'll get a `Result<[T; N], E>`.
7373
/// If you return `Option<T>` from the closure, you'll get an `Option<[T; N]>`.
7474
///
7575
/// # Arguments
@@ -522,7 +522,7 @@ impl<T, const N: usize> [T; N] {
522522
/// return an array the same size as `self` or the first error encountered.
523523
///
524524
/// The return type of this function depends on the return type of the closure.
525-
/// If you return `Result<T, E>` from the closure, you'll get a `Result<[T; N]; E>`.
525+
/// If you return `Result<T, E>` from the closure, you'll get a `Result<[T; N], E>`.
526526
/// If you return `Option<T>` from the closure, you'll get an `Option<[T; N]>`.
527527
///
528528
/// # Examples

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2734,7 +2734,7 @@ pub trait Iterator {
27342734
/// the first true result or the first error.
27352735
///
27362736
/// The return type of this method depends on the return type of the closure.
2737-
/// If you return `Result<bool, E>` from the closure, you'll get a `Result<Option<Self::Item>; E>`.
2737+
/// If you return `Result<bool, E>` from the closure, you'll get a `Result<Option<Self::Item>, E>`.
27382738
/// If you return `Option<bool>` from the closure, you'll get an `Option<Option<Self::Item>>`.
27392739
///
27402740
/// # Examples

library/core/src/slice/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3795,7 +3795,7 @@ impl<T> [T] {
37953795
/// The slice is assumed to be partitioned according to the given predicate.
37963796
/// This means that all elements for which the predicate returns true are at the start of the slice
37973797
/// and all elements for which the predicate returns false are at the end.
3798-
/// For example, [7, 15, 3, 5, 4, 12, 6] is a partitioned under the predicate x % 2 != 0
3798+
/// For example, `[7, 15, 3, 5, 4, 12, 6]` is partitioned under the predicate `x % 2 != 0`
37993799
/// (all odd numbers are at the start, all even at the end).
38003800
///
38013801
/// If this slice is not partitioned, the returned result is unspecified and meaningless,

0 commit comments

Comments
 (0)