From e674d2d368afbc500ec84759396a78a4de5ba483 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 1 Jun 2021 13:49:32 +0100 Subject: [PATCH] multicore: Documentation tweaks Co-authored-by: Daira Hopwood --- CHANGELOG.md | 3 ++- src/multicore.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc7bee67..982d41398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to Rust's notion of ### Added - `BELLMAN_NUM_CPUS` environment variable, which can be used to control the number of logical CPUs that `bellman` will use when the (default) `multicore` - feature flag is enabled. + feature flag is enabled. The default (which has not changed) is to use the + `num_cpus` crate to determine the number of logical CPUs. - `bellman::multicore::Waiter` ### Changed diff --git a/src/multicore.rs b/src/multicore.rs index 149829e11..f7c0430b2 100644 --- a/src/multicore.rs +++ b/src/multicore.rs @@ -114,7 +114,7 @@ mod implementation { self.receiver.recv().unwrap() } - /// One off sending. + /// One-off sending. pub fn done(val: T) -> Self { let (sender, receiver) = bounded(1); sender.send(val).unwrap(); @@ -185,10 +185,10 @@ mod implementation { impl Waiter { /// Wait for the result. pub fn wait(&mut self) -> T { - self.val.take().unwrap() + self.val.take().expect("unmet data dependency") } - /// One off sending. + /// One-off sending. pub fn done(val: T) -> Self { Waiter { val: Some(val) } }