Skip to content

Commit a1c21f8

Browse files
committed
Auto merge of rust-lang#97304 - Dylan-DPC:rollup-qxrfddc, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#97087 (Clarify slice and Vec iteration order) - rust-lang#97254 (Remove feature: `crate` visibility modifier) - rust-lang#97271 (Add regression test for rust-lang#91949) - rust-lang#97294 (std::time : fix variable name in the doc) - rust-lang#97303 (Fix some typos in arg checking algorithm) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 421232a + bfd5376 commit a1c21f8

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

alloc/src/vec/mod.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -2626,10 +2626,13 @@ impl<T, A: Allocator> IntoIterator for Vec<T, A> {
26262626
///
26272627
/// ```
26282628
/// let v = vec!["a".to_string(), "b".to_string()];
2629-
/// for s in v.into_iter() {
2630-
/// // s has type String, not &String
2631-
/// println!("{s}");
2632-
/// }
2629+
/// let mut v_iter = v.into_iter();
2630+
///
2631+
/// let first_element: Option<String> = v_iter.next();
2632+
///
2633+
/// assert_eq!(first_element, Some("a".to_string()));
2634+
/// assert_eq!(v_iter.next(), Some("b".to_string()));
2635+
/// assert_eq!(v_iter.next(), None);
26332636
/// ```
26342637
#[inline]
26352638
fn into_iter(self) -> IntoIter<T, A> {

core/src/slice/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,8 @@ impl<T> [T] {
716716

717717
/// Returns an iterator over the slice.
718718
///
719+
/// The iterator yields all items from start to end.
720+
///
719721
/// # Examples
720722
///
721723
/// ```
@@ -735,6 +737,8 @@ impl<T> [T] {
735737

736738
/// Returns an iterator that allows modifying each value.
737739
///
740+
/// The iterator yields all items from start to end.
741+
///
738742
/// # Examples
739743
///
740744
/// ```

std/src/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ pub use core::time::FromFloatSecsError;
9595
/// use std::time::{Instant, Duration};
9696
///
9797
/// let now = Instant::now();
98-
/// let max_nanoseconds = u64::MAX / 1_000_000_000;
99-
/// let duration = Duration::new(max_nanoseconds, 0);
98+
/// let max_seconds = u64::MAX / 1_000_000_000;
99+
/// let duration = Duration::new(max_seconds, 0);
100100
/// println!("{:?}", now + duration);
101101
/// ```
102102
///

0 commit comments

Comments
 (0)