aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/sync/mpsc/select.rs
diff options
context:
space:
mode:
authorFenrir <[email protected]>2018-01-21 14:06:28 -0700
committerFenrirWolf <[email protected]>2018-01-21 19:16:33 -0700
commit23be3f4885688e5e0011005e2295c75168854c0a (patch)
treedd0850f9c73c489e114a761d5c0757f3dbec3a65 /ctr-std/src/sync/mpsc/select.rs
parentUpdate CI for Rust nightly-2017-12-01 + other fixes (diff)
downloadarchived-ctru-rs-23be3f4885688e5e0011005e2295c75168854c0a.tar.xz
archived-ctru-rs-23be3f4885688e5e0011005e2295c75168854c0a.zip
Recreate ctr-std from latest nightly
Diffstat (limited to 'ctr-std/src/sync/mpsc/select.rs')
-rw-r--r--ctr-std/src/sync/mpsc/select.rs22
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 { .. }");
- }
}