File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ use clone::Clone;
23
23
use comm:: { Sender , Receiver , channel} ;
24
24
use io;
25
25
use iter:: Iterator ;
26
+ use kinds:: Send ;
26
27
use mem:: drop;
27
28
use option:: { Some , None } ;
28
29
use result:: { Ok , Err } ;
@@ -63,25 +64,23 @@ pub enum Signum {
63
64
///
64
65
/// # Example
65
66
///
66
- /// ```rust,ignore
67
+ /// ```rust,no_run
68
+ /// # #![allow(unused_must_use)]
67
69
/// use std::io::signal::{Listener, Interrupt};
68
70
///
69
71
/// let mut listener = Listener::new();
70
72
/// listener.register(Interrupt);
71
73
///
72
- /// spawn({
73
- /// loop {
74
- /// match listener.rx.recv() {
75
- /// Interrupt => println!("Got Interrupt'ed"),
76
- /// _ => (),
77
- /// }
74
+ /// loop {
75
+ /// match listener.rx.recv() {
76
+ /// Interrupt => println!("Got Interrupt'ed"),
77
+ /// _ => (),
78
78
/// }
79
- /// });
80
- ///
79
+ /// }
81
80
/// ```
82
81
pub struct Listener {
83
82
/// A map from signums to handles to keep the handles in memory
84
- handles : ~[ ( Signum , ~RtioSignal ) ] ,
83
+ handles : ~[ ( Signum , ~RtioSignal : Send ) ] ,
85
84
/// This is where all the handles send signums, which are received by
86
85
/// the clients from the receiver.
87
86
tx : Sender < Signum > ,
You can’t perform that action at this time.
0 commit comments