Skip to content

Commit 4695bf0

Browse files
committed
Remove another invalid example
1 parent 4cf5930 commit 4695bf0

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/libstd/sync/mpsc/mod.rs

-26
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,6 @@
112112
//! });
113113
//! rx.recv().unwrap();
114114
//! ```
115-
//!
116-
//! This second example is more costly since it allocates a new timer every
117-
//! time a message is received, but it allows you to timeout after the channel
118-
//! has been inactive for 5 seconds:
119-
//!
120-
//! ```no_run
121-
//! # #![feature(std_misc, old_io)]
122-
//! use std::sync::mpsc::channel;
123-
//! use std::old_io::timer::Timer;
124-
//! use std::time::Duration;
125-
//!
126-
//! let (tx, rx) = channel::<i32>();
127-
//! let mut timer = Timer::new().unwrap();
128-
//!
129-
//! loop {
130-
//! let timeout = timer.oneshot(Duration::seconds(5));
131-
//!
132-
//! select! {
133-
//! val = rx.recv() => println!("Received {}", val.unwrap()),
134-
//! _ = timeout.recv() => {
135-
//! println!("timed out, no message received in 5 seconds");
136-
//! break;
137-
//! }
138-
//! }
139-
//! }
140-
//! ```
141115
142116
#![stable(feature = "rust1", since = "1.0.0")]
143117

0 commit comments

Comments
 (0)