35
35
//!
36
36
//! ```
37
37
//! use std::sync::Arc;
38
- //! use std::thread::Thread ;
38
+ //! use std::thread;
39
39
//!
40
40
//! let five = Arc::new(5);
41
41
//!
42
42
//! for _ in 0..10 {
43
43
//! let five = five.clone();
44
44
//!
45
- //! Thread ::spawn(move || {
45
+ //! thread ::spawn(move || {
46
46
//! println!("{:?}", five);
47
47
//! });
48
48
//! }
52
52
//!
53
53
//! ```
54
54
//! use std::sync::{Arc, Mutex};
55
- //! use std::thread::Thread ;
55
+ //! use std::thread;
56
56
//!
57
57
//! let five = Arc::new(Mutex::new(5));
58
58
//!
59
59
//! for _ in 0..10 {
60
60
//! let five = five.clone();
61
61
//!
62
- //! Thread ::spawn(move || {
62
+ //! thread ::spawn(move || {
63
63
//! let mut number = five.lock().unwrap();
64
64
//!
65
65
//! *number += 1;
@@ -95,7 +95,7 @@ use heap::deallocate;
95
95
///
96
96
/// ```rust
97
97
/// use std::sync::Arc;
98
- /// use std::thread::Thread ;
98
+ /// use std::thread;
99
99
///
100
100
/// fn main() {
101
101
/// let numbers: Vec<_> = (0..100u32).map(|i| i as f32).collect();
@@ -104,7 +104,7 @@ use heap::deallocate;
104
104
/// for _ in 0..10 {
105
105
/// let child_numbers = shared_numbers.clone();
106
106
///
107
- /// Thread ::spawn(move || {
107
+ /// thread ::spawn(move || {
108
108
/// let local_numbers = child_numbers.as_slice();
109
109
///
110
110
/// // Work with the local numbers
@@ -621,7 +621,7 @@ mod tests {
621
621
use std:: option:: Option :: { Some , None } ;
622
622
use std:: sync:: atomic;
623
623
use std:: sync:: atomic:: Ordering :: { Acquire , SeqCst } ;
624
- use std:: thread:: Thread ;
624
+ use std:: thread;
625
625
use std:: vec:: Vec ;
626
626
use super :: { Arc , Weak , weak_count, strong_count} ;
627
627
use std:: sync:: Mutex ;
@@ -648,7 +648,7 @@ mod tests {
648
648
649
649
let ( tx, rx) = channel ( ) ;
650
650
651
- let _t = Thread :: spawn ( move || {
651
+ let _t = thread :: spawn ( move || {
652
652
let arc_v: Arc < Vec < i32 > > = rx. recv ( ) . unwrap ( ) ;
653
653
assert_eq ! ( ( * arc_v) [ 3 ] , 4 ) ;
654
654
} ) ;
0 commit comments