]> git.lizzy.rs Git - rust.git/commitdiff
Fix OnceWith docstring.
authorGeoffry Song <goffrie@gmail.com>
Fri, 29 Mar 2019 22:03:14 +0000 (15:03 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Mar 2019 22:03:14 +0000 (15:03 -0700)
This was incorrectly copypasta'd from RepeatWith.

src/libcore/iter/sources.rs

index ffc24df3ed42e2cc0e07ef6b712afd438d90f3ba..7934e5880d7d29fba1a5790ee1687abddfb23bc0 100644 (file)
@@ -375,8 +375,8 @@ pub fn once<T>(value: T) -> Once<T> {
     Once { inner: Some(value).into_iter() }
 }
 
-/// An iterator that repeats elements of type `A` endlessly by
-/// applying the provided closure `F: FnMut() -> A`.
+/// An iterator that yields a single element of type `A` by
+/// applying the provided closure `F: FnOnce() -> A`.
 ///
 /// This `struct` is created by the [`once_with`] function.
 /// See its documentation for more.