From d3a407a4336124996c379c62647b45ec962e50ea Mon Sep 17 00:00:00 2001 From: wangzengdi Date: Fri, 20 Sep 2019 07:02:29 +0800 Subject: [PATCH] optimize variable: min -> max (#534) --- src/concurrency/thread/crossbeam-spawn.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/concurrency/thread/crossbeam-spawn.md b/src/concurrency/thread/crossbeam-spawn.md index df9e2be..81474f1 100644 --- a/src/concurrency/thread/crossbeam-spawn.md +++ b/src/concurrency/thread/crossbeam-spawn.md @@ -32,10 +32,10 @@ fn find_max(arr: &[i32]) -> Option { let thread_l = s.spawn(|_| find_max(left)); let thread_r = s.spawn(|_| find_max(right)); - let min_l = thread_l.join().unwrap()?; - let min_r = thread_r.join().unwrap()?; + let max_l = thread_l.join().unwrap()?; + let max_r = thread_r.join().unwrap()?; - Some(min_l.max(min_r)) + Some(max_l.max(max_r)) }).unwrap() } ```