• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

rayonパッケージ


Commit MetaInfo

Revisión9b92c7deb93aedda14ca4401c5fc40a7cff596b0 (tree)
Tiempo2019-12-20 04:52:51
AutorJosh Stone <cuviper@gmai...>
CommiterJosh Stone

Log Message

cargo fmt

Cambiar Resumen

Diferencia incremental

--- a/rayon-core/src/job.rs
+++ b/rayon-core/src/job.rs
@@ -1,9 +1,9 @@
1-use crossbeam_queue::SegQueue;
21 use crate::latch::Latch;
2+use crate::unwind;
3+use crossbeam_queue::SegQueue;
34 use std::any::Any;
45 use std::cell::UnsafeCell;
56 use std::mem;
6-use crate::unwind;
77
88 pub(super) enum JobResult<T> {
99 None,
--- a/rayon-core/src/join/mod.rs
+++ b/rayon-core/src/join/mod.rs
@@ -2,8 +2,8 @@ use crate::job::StackJob;
22 use crate::latch::{LatchProbe, SpinLatch};
33 use crate::log::Event::*;
44 use crate::registry::{self, WorkerThread};
5-use std::any::Any;
65 use crate::unwind;
6+use std::any::Any;
77
88 use crate::FnContext;
99
--- a/rayon-core/src/join/test.rs
+++ b/rayon-core/src/join/test.rs
@@ -1,11 +1,11 @@
11 //! Tests for the join code.
22
33 use crate::join::*;
4+use crate::unwind;
5+use crate::ThreadPoolBuilder;
46 use rand::distributions::Standard;
57 use rand::{Rng, SeedableRng};
68 use rand_xorshift::XorShiftRng;
7-use crate::unwind;
8-use crate::ThreadPoolBuilder;
99
1010 fn quick_sort<T: PartialOrd + Send>(v: &mut [T]) {
1111 if v.len() <= 1 {
--- a/rayon-core/src/registry.rs
+++ b/rayon-core/src/registry.rs
@@ -1,9 +1,14 @@
1-use crossbeam_deque::{Steal, Stealer, Worker};
2-use crossbeam_queue::SegQueue;
31 use crate::job::{JobFifo, JobRef, StackJob};
42 use crate::latch::{CountLatch, Latch, LatchProbe, LockLatch, SpinLatch, TickleLatch};
53 use crate::log::Event::*;
64 use crate::sleep::Sleep;
5+use crate::unwind;
6+use crate::util::leak;
7+use crate::{
8+ ErrorKind, ExitHandler, PanicHandler, StartHandler, ThreadPoolBuildError, ThreadPoolBuilder,
9+};
10+use crossbeam_deque::{Steal, Stealer, Worker};
11+use crossbeam_queue::SegQueue;
712 use std::any::Any;
813 use std::cell::Cell;
914 use std::collections::hash_map::DefaultHasher;
@@ -18,9 +23,6 @@ use std::sync::atomic::{AtomicUsize, Ordering};
1823 use std::sync::{Arc, Once};
1924 use std::thread;
2025 use std::usize;
21-use crate::unwind;
22-use crate::util::leak;
23-use crate::{ErrorKind, ExitHandler, PanicHandler, StartHandler, ThreadPoolBuildError, ThreadPoolBuilder};
2426
2527 /// Thread builder used for customization via
2628 /// [`ThreadPoolBuilder::spawn_handler`](struct.ThreadPoolBuilder.html#method.spawn_handler).
--- a/rayon-core/src/scope/mod.rs
+++ b/rayon-core/src/scope/mod.rs
@@ -8,6 +8,7 @@ use crate::job::{HeapJob, JobFifo};
88 use crate::latch::{CountLatch, Latch};
99 use crate::log::Event::*;
1010 use crate::registry::{in_worker, Registry, WorkerThread};
11+use crate::unwind;
1112 use std::any::Any;
1213 use std::fmt;
1314 use std::marker::PhantomData;
@@ -15,7 +16,6 @@ use std::mem;
1516 use std::ptr;
1617 use std::sync::atomic::{AtomicPtr, Ordering};
1718 use std::sync::Arc;
18-use crate::unwind;
1919
2020 #[cfg(test)]
2121 mod test;
--- a/rayon-core/src/scope/test.rs
+++ b/rayon-core/src/scope/test.rs
@@ -1,3 +1,6 @@
1+use crate::unwind;
2+use crate::ThreadPoolBuilder;
3+use crate::{scope, scope_fifo, Scope};
14 use rand::{Rng, SeedableRng};
25 use rand_xorshift::XorShiftRng;
36 use std::cmp;
@@ -5,9 +8,6 @@ use std::iter::once;
58 use std::sync::atomic::{AtomicUsize, Ordering};
69 use std::sync::Mutex;
710 use std::vec;
8-use crate::unwind;
9-use crate::ThreadPoolBuilder;
10-use crate::{scope, scope_fifo, Scope};
1111
1212 #[test]
1313 fn scope_empty() {
--- a/rayon-core/src/spawn/mod.rs
+++ b/rayon-core/src/spawn/mod.rs
@@ -1,8 +1,8 @@
11 use crate::job::*;
22 use crate::registry::Registry;
3+use crate::unwind;
34 use std::mem;
45 use std::sync::Arc;
5-use crate::unwind;
66
77 /// Fires off a task into the Rayon threadpool in the "static" or
88 /// "global" scope. Just like a standard thread, this task is not
--- a/rayon-core/src/test.rs
+++ b/rayon-core/src/test.rs
@@ -1,10 +1,10 @@
11 #![cfg(test)]
22
3-use std::sync::atomic::{AtomicUsize, Ordering};
4-use std::sync::{Arc, Barrier};
53 #[allow(deprecated)]
64 use crate::Configuration;
75 use crate::{ThreadPoolBuildError, ThreadPoolBuilder};
6+use std::sync::atomic::{AtomicUsize, Ordering};
7+use std::sync::{Arc, Barrier};
88
99 #[test]
1010 fn worker_thread_index() {
--- a/rayon-core/src/thread_pool/mod.rs
+++ b/rayon-core/src/thread_pool/mod.rs
@@ -6,14 +6,14 @@
66 use crate::join;
77 use crate::registry::{Registry, ThreadSpawn, WorkerThread};
88 use crate::spawn;
9-use std::error::Error;
10-use std::fmt;
11-use std::sync::Arc;
129 #[allow(deprecated)]
1310 use crate::Configuration;
1411 use crate::{scope, Scope};
1512 use crate::{scope_fifo, ScopeFifo};
1613 use crate::{ThreadPoolBuildError, ThreadPoolBuilder};
14+use std::error::Error;
15+use std::fmt;
16+use std::sync::Arc;
1717
1818 mod test;
1919
--- a/rayon-demo/src/main.rs
+++ b/rayon-demo/src/main.rs
@@ -42,10 +42,10 @@ extern crate serde_derive; // all
4242 extern crate glium; // nbody
4343 #[macro_use]
4444 extern crate lazy_static; // find
45-#[cfg(windows)]
46-extern crate winapi; // life
4745 #[cfg(test)]
4846 extern crate test;
47+#[cfg(windows)]
48+extern crate winapi; // life
4949
5050 const USAGE: &str = "
5151 Usage: rayon-demo bench
--- a/src/iter/extend.rs
+++ b/src/iter/extend.rs
@@ -285,12 +285,7 @@ impl<'a> ParallelExtend<&'a char> for String {
285285 }
286286
287287 fn string_reserve<T: AsRef<str>>(string: &mut String, list: &LinkedList<Vec<T>>) {
288- let len = list
289- .iter()
290- .flatten()
291- .map(T::as_ref)
292- .map(str::len)
293- .sum();
288+ let len = list.iter().flatten().map(T::as_ref).map(str::len).sum();
294289 string.reserve(len);
295290 }
296291
--- a/src/range.rs
+++ b/src/range.rs
@@ -286,8 +286,8 @@ fn test_u128_opt_len() {
286286 #[test]
287287 #[cfg(target_pointer_width = "64")]
288288 fn test_usize_i64_overflow() {
289- use std::i64;
290289 use crate::ThreadPoolBuilder;
290+ use std::i64;
291291
292292 let iter = (-2..i64::MAX).into_par_iter();
293293 assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 2));
--- a/src/range_inclusive.rs
+++ b/src/range_inclusive.rs
@@ -191,8 +191,8 @@ fn test_u128_opt_len() {
191191 #[test]
192192 #[cfg(target_pointer_width = "64")]
193193 fn test_usize_i64_overflow() {
194- use std::i64;
195194 use crate::ThreadPoolBuilder;
195+ use std::i64;
196196
197197 let iter = (-2..=i64::MAX).into_par_iter();
198198 assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 3));