Skip to content

Commit 630bbdd

Browse files
Philippe-Choletjswrenn
authored andcommitted
Deprecate unfold for std::iter::from_fn
1 parent d5709c7 commit 630bbdd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sources.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ where
9898
/// vec![1, 1, 2, 3, 5, 8, 13, 21]);
9999
/// assert_eq!(fibonacci.last(), Some(2_971_215_073))
100100
/// ```
101+
#[deprecated(note = "Use std from_fn() instead", since = "0.13.0")]
101102
pub fn unfold<A, St, F>(initial_state: St, f: F) -> Unfold<St, F>
102103
where
103104
F: FnMut(&mut St) -> Option<A>,
@@ -118,6 +119,7 @@ where
118119
/// See [`unfold`](crate::unfold) for more information.
119120
#[derive(Clone)]
120121
#[must_use = "iterators are lazy and do nothing unless consumed"]
122+
#[deprecated(note = "Use std from_fn() instead", since = "0.13.0")]
121123
pub struct Unfold<St, F> {
122124
f: F,
123125
/// Internal state that will be passed to the closure on the next iteration

0 commit comments

Comments
 (0)