Skip to content

Commit b02b38e

Browse files
committed
Add the unstable attribute to the new mpsc::Receiver::try_iter API
1 parent b354887 commit b02b38e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libstd/sync/mpsc/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ pub struct Iter<'a, T: 'a> {
317317
///
318318
/// This Iterator will never block the caller in order to wait for data to
319319
/// become available. Instead, it will return `None`.
320+
#[unstable(feature = "receiver_try_iter")]
320321
pub struct TryIter<'a, T: 'a> {
321322
rx: &'a Receiver<T>
322323
}
@@ -997,6 +998,7 @@ impl<T> Receiver<T> {
997998
/// It will return `None` if there are no more pending values or if the
998999
/// channel has hung up. The iterator will never `panic!` or block the
9991000
/// user by waiting for values.
1001+
#[unstable(feature = "receiver_try_iter")]
10001002
pub fn try_iter(&self) -> TryIter<T> {
10011003
TryIter { rx: self }
10021004
}
@@ -1096,6 +1098,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
10961098
fn next(&mut self) -> Option<T> { self.rx.recv().ok() }
10971099
}
10981100

1101+
#[unstable(feature = "receiver_try_iter")]
10991102
impl<'a, T> Iterator for TryIter<'a, T> {
11001103
type Item = T;
11011104

0 commit comments

Comments
 (0)