about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-10-06 13:18:34 +0200
committerGitHub <noreply@github.com>2023-10-06 13:18:34 +0200
commit382701e6b6c4b65b5f4a00d6092cf8cef91f1181 (patch)
tree78af0c1986e397159bd955cd47f281c10586e743
parent525c661842b5fd6be5b191a4f6baa2c79d722e36 (diff)
parent71429f5fd2388ff6332889c193409a88c762e7c1 (diff)
downloadrust-382701e6b6c4b65b5f4a00d6092cf8cef91f1181.tar.gz
rust-382701e6b6c4b65b5f4a00d6092cf8cef91f1181.zip
Rollup merge of #115588 - tifv:fix-comment-successors, r=scottmcm
Fix a comment in std::iter::successors

The `unfold` function have since #58062 been renamed to `from_fn`.
(I'm not sure if this whole comment is still useful—it's not like there are many iterators that *can't* be based on `from_fn`. Anyway, in its current form this comment is not correct, and it sent me into a half-hour research of what happened to `unfold` function, so I want to do *something* with it :upside_down_face: deleting these three lines is a perfectly fine alternative, in my opinion.)
-rw-r--r--library/core/src/iter/sources/successors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/iter/sources/successors.rs b/library/core/src/iter/sources/successors.rs
index 6a6cbe905e4..7f7b2c77566 100644
--- a/library/core/src/iter/sources/successors.rs
+++ b/library/core/src/iter/sources/successors.rs
@@ -17,7 +17,7 @@ where
     F: FnMut(&T) -> Option<T>,
 {
     // If this function returned `impl Iterator<Item=T>`
-    // it could be based on `unfold` and not need a dedicated type.
+    // it could be based on `from_fn` and not need a dedicated type.
     // However having a named `Successors<T, F>` type allows it to be `Clone` when `T` and `F` are.
     Successors { next: first, succ }
 }