@@ -32,18 +32,9 @@ use std::io;
32
32
use std:: marker:: PhantomData ;
33
33
use std:: str:: FromStr ;
34
34
35
- extern crate crossbeam_deque;
36
- extern crate crossbeam_queue;
37
- extern crate crossbeam_utils;
38
35
#[ cfg( any( debug_assertions, rayon_unstable) ) ]
39
36
#[ macro_use]
40
37
extern crate lazy_static;
41
- extern crate num_cpus;
42
-
43
- #[ cfg( test) ]
44
- extern crate rand;
45
- #[ cfg( test) ]
46
- extern crate rand_xorshift;
47
38
48
39
#[ macro_use]
49
40
mod log;
@@ -66,16 +57,19 @@ mod test;
66
57
67
58
#[ cfg( rayon_unstable) ]
68
59
pub mod internal;
69
- pub use join:: { join, join_context} ;
70
- pub use registry:: ThreadBuilder ;
71
- pub use scope:: { scope, Scope } ;
72
- pub use scope:: { scope_fifo, ScopeFifo } ;
73
- pub use spawn:: { spawn, spawn_fifo} ;
74
- pub use thread_pool:: current_thread_has_pending_tasks;
75
- pub use thread_pool:: current_thread_index;
76
- pub use thread_pool:: ThreadPool ;
77
60
78
- use registry:: { CustomSpawn , DefaultSpawn , ThreadSpawn } ;
61
+ pub use self :: join:: { join, join_context} ;
62
+ pub use self :: registry:: ThreadBuilder ;
63
+ pub use self :: scope:: { scope, Scope } ;
64
+ pub use self :: scope:: { scope_fifo, ScopeFifo } ;
65
+ pub use self :: spawn:: { spawn, spawn_fifo} ;
66
+ pub use self :: thread_pool:: current_thread_has_pending_tasks;
67
+ pub use self :: thread_pool:: current_thread_index;
68
+ pub use self :: thread_pool:: ThreadPool ;
69
+
70
+ use crossbeam_utils;
71
+ use num_cpus;
72
+ use self :: registry:: { CustomSpawn , DefaultSpawn , ThreadSpawn } ;
79
73
80
74
/// Returns the number of threads in the current registry. If this
81
75
/// code is executing within a Rayon thread-pool, then this will be
@@ -96,7 +90,7 @@ use registry::{CustomSpawn, DefaultSpawn, ThreadSpawn};
96
90
///
97
91
/// [snt]: struct.ThreadPoolBuilder.html#method.num_threads
98
92
pub fn current_num_threads ( ) -> usize {
99
- :: registry:: Registry :: current_num_threads ( )
93
+ crate :: registry:: Registry :: current_num_threads ( )
100
94
}
101
95
102
96
/// Error when initializing a thread pool.
@@ -667,7 +661,7 @@ impl Error for ThreadPoolBuildError {
667
661
}
668
662
669
663
impl fmt:: Display for ThreadPoolBuildError {
670
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
664
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
671
665
match self . kind {
672
666
ErrorKind :: IOError ( ref e) => e. fmt ( f) ,
673
667
_ => self . description ( ) . fmt ( f) ,
@@ -683,7 +677,7 @@ pub fn initialize(config: Configuration) -> Result<(), Box<dyn Error>> {
683
677
}
684
678
685
679
impl < S > fmt:: Debug for ThreadPoolBuilder < S > {
686
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
680
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
687
681
let ThreadPoolBuilder {
688
682
ref num_threads,
689
683
ref get_thread_name,
@@ -699,7 +693,7 @@ impl<S> fmt::Debug for ThreadPoolBuilder<S> {
699
693
// output.
700
694
struct ClosurePlaceholder ;
701
695
impl fmt:: Debug for ClosurePlaceholder {
702
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
696
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
703
697
f. write_str ( "<closure>" )
704
698
}
705
699
}
@@ -731,7 +725,7 @@ impl Default for Configuration {
731
725
732
726
#[ allow( deprecated) ]
733
727
impl fmt:: Debug for Configuration {
734
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
728
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
735
729
self . builder . fmt ( f)
736
730
}
737
731
}
0 commit comments