diff options
Diffstat (limited to 'ctr-std/src/sync/mpsc/select.rs')
| -rw-r--r-- | ctr-std/src/sync/mpsc/select.rs | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/ctr-std/src/sync/mpsc/select.rs b/ctr-std/src/sync/mpsc/select.rs index 8b4da53..a9f3cea 100644 --- a/ctr-std/src/sync/mpsc/select.rs +++ b/ctr-std/src/sync/mpsc/select.rs @@ -148,12 +148,12 @@ impl Select { let id = self.next_id.get(); self.next_id.set(id + 1); Handle { - id: id, + id, selector: self.inner.get(), next: ptr::null_mut(), prev: ptr::null_mut(), added: false, - rx: rx, + rx, packet: rx, } } @@ -354,13 +354,13 @@ impl Iterator for Packets { impl fmt::Debug for Select { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Select {{ .. }}") + f.debug_struct("Select").finish() } } impl<'rx, T:Send+'rx> fmt::Debug for Handle<'rx, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Handle {{ .. }}") + f.debug_struct("Handle").finish() } } @@ -774,18 +774,4 @@ mod tests { } } } - - #[test] - fn fmt_debug_select() { - let sel = Select::new(); - assert_eq!(format!("{:?}", sel), "Select { .. }"); - } - - #[test] - fn fmt_debug_handle() { - let (_, rx) = channel::<i32>(); - let sel = Select::new(); - let handle = sel.handle(&rx); - assert_eq!(format!("{:?}", handle), "Handle { .. }"); - } } |