]> git.lizzy.rs Git - rust.git/commitdiff
Remove another invalid example
authorŁukasz Niemier <lukasz@niemier.pl>
Tue, 7 Apr 2015 19:46:14 +0000 (21:46 +0200)
committerŁukasz Niemier <lukasz@niemier.pl>
Tue, 7 Apr 2015 19:46:14 +0000 (21:46 +0200)
src/libstd/sync/mpsc/mod.rs

index a955f88164c4ffd57f33aa1ce1a5fe0bc19083cf..e5444843516008bcfd66df49d7d19dab513f86cb 100644 (file)
 //! });
 //! rx.recv().unwrap();
 //! ```
-//!
-//! This second example is more costly since it allocates a new timer every
-//! time a message is received, but it allows you to timeout after the channel
-//! has been inactive for 5 seconds:
-//!
-//! ```no_run
-//! # #![feature(std_misc, old_io)]
-//! use std::sync::mpsc::channel;
-//! use std::old_io::timer::Timer;
-//! use std::time::Duration;
-//!
-//! let (tx, rx) = channel::<i32>();
-//! let mut timer = Timer::new().unwrap();
-//!
-//! loop {
-//!     let timeout = timer.oneshot(Duration::seconds(5));
-//!
-//!     select! {
-//!         val = rx.recv() => println!("Received {}", val.unwrap()),
-//!         _ = timeout.recv() => {
-//!             println!("timed out, no message received in 5 seconds");
-//!             break;
-//!         }
-//!     }
-//! }
-//! ```
 
 #![stable(feature = "rust1", since = "1.0.0")]