Skip to content

std: Fix a doc example on io::signal #13354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/libstd/io/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use clone::Clone;
use comm::{Sender, Receiver, channel};
use io;
use iter::Iterator;
use kinds::Send;
use mem::drop;
use option::{Some, None};
use result::{Ok, Err};
Expand Down Expand Up @@ -63,25 +64,23 @@ pub enum Signum {
///
/// # Example
///
/// ```rust,ignore
/// ```rust,no_run
/// # #![allow(unused_must_use)]
/// use std::io::signal::{Listener, Interrupt};
///
/// let mut listener = Listener::new();
/// listener.register(Interrupt);
///
/// spawn({
/// loop {
/// match listener.rx.recv() {
/// Interrupt => println!("Got Interrupt'ed"),
/// _ => (),
/// }
/// loop {
/// match listener.rx.recv() {
/// Interrupt => println!("Got Interrupt'ed"),
/// _ => (),
/// }
/// });
///
/// }
/// ```
pub struct Listener {
/// A map from signums to handles to keep the handles in memory
handles: ~[(Signum, ~RtioSignal)],
handles: ~[(Signum, ~RtioSignal:Send)],
/// This is where all the handles send signums, which are received by
/// the clients from the receiver.
tx: Sender<Signum>,
Expand Down