Skip to content

Commit 554fd14

Browse files
committed
API: Deprecate repeat_call in favour of repeat_with
1 parent 0bfd61b commit 554fd14

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ pub mod structs {
9595
#[cfg(feature = "use_std")]
9696
pub use rciter_impl::RcIter;
9797
pub use repeatn::RepeatN;
98+
#[allow(deprecated)]
9899
pub use sources::{RepeatCall, Unfold, Iterate};
99100
#[cfg(feature = "use_std")]
100101
pub use tee::Tee;
@@ -118,6 +119,7 @@ pub use minmax::MinMaxResult;
118119
pub use peeking_take_while::PeekingNext;
119120
pub use process_results_impl::process_results;
120121
pub use repeatn::repeat_n;
122+
#[allow(deprecated)]
121123
pub use sources::{repeat_call, unfold, iterate};
122124
pub use with_position::Position;
123125
pub use ziptuple::multizip;

src/sources.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
//! Iterators that are sources (produce elements from parameters,
22
//! not from another iterator).
3+
#![allow(deprecated)]
34

45
use std::fmt;
56
use std::mem;
67

78
/// See [`repeat_call`](../fn.repeat_call.html) for more information.
9+
#[deprecated(note="Use std repeat_with() instead", since="0.8")]
810
pub struct RepeatCall<F> {
911
f: F,
1012
}
@@ -36,6 +38,7 @@ impl<F> fmt::Debug for RepeatCall<F>
3638
/// vec![1, 1, 1, 1, 1]
3739
/// );
3840
/// ```
41+
#[deprecated(note="Use std repeat_with() instead", since="0.8")]
3942
pub fn repeat_call<F, A>(function: F) -> RepeatCall<F>
4043
where F: FnMut() -> A
4144
{

0 commit comments

Comments
 (0)