@@ -9,12 +9,12 @@ use std::sync::atomic::{AtomicUsize, Ordering};
9
9
use std:: sync:: mpsc:: { channel, Receiver , Sender } ;
10
10
use std:: sync:: Arc ;
11
11
12
- use super :: { perform, CompletedIO , Executor , Item } ;
12
+ use super :: { perform, CompletedIo , Executor , Item } ;
13
13
use crate :: utils:: notifications:: Notification ;
14
14
use crate :: utils:: units:: Unit ;
15
15
16
16
enum Task {
17
- Request ( CompletedIO ) ,
17
+ Request ( CompletedIo ) ,
18
18
// Used to synchronise in the join method.
19
19
Sentinel ,
20
20
}
@@ -60,19 +60,19 @@ impl<'a> Threaded<'a> {
60
60
let n_files = self . n_files . clone ( ) ;
61
61
self . pool . execute ( move || {
62
62
let chunk_complete_callback = |size| {
63
- tx. send ( Task :: Request ( CompletedIO :: Chunk ( size) ) )
63
+ tx. send ( Task :: Request ( CompletedIo :: Chunk ( size) ) )
64
64
. expect ( "receiver should be listening" )
65
65
} ;
66
66
perform ( & mut item, chunk_complete_callback) ;
67
67
n_files. fetch_sub ( 1 , Ordering :: Relaxed ) ;
68
- tx. send ( Task :: Request ( CompletedIO :: Item ( item) ) )
68
+ tx. send ( Task :: Request ( CompletedIo :: Item ( item) ) )
69
69
. expect ( "receiver should be listening" ) ;
70
70
} ) ;
71
71
}
72
72
}
73
73
74
74
impl < ' a > Executor for Threaded < ' a > {
75
- fn dispatch ( & self , item : Item ) -> Box < dyn Iterator < Item = CompletedIO > + ' _ > {
75
+ fn dispatch ( & self , item : Item ) -> Box < dyn Iterator < Item = CompletedIo > + ' _ > {
76
76
// Yield any completed work before accepting new work - keep memory
77
77
// pressure under control
78
78
// - return an iterator that runs until we can submit and then submits
@@ -83,7 +83,7 @@ impl<'a> Executor for Threaded<'a> {
83
83
} )
84
84
}
85
85
86
- fn join ( & mut self ) -> Box < dyn Iterator < Item = CompletedIO > + ' _ > {
86
+ fn join ( & mut self ) -> Box < dyn Iterator < Item = CompletedIo > + ' _ > {
87
87
// Some explanation is in order. Even though the tar we are reading from (if
88
88
// any) will have had its FileWithProgress download tracking
89
89
// completed before we hit drop, that is not true if we are unwinding due to a
@@ -149,7 +149,7 @@ impl<'a> Executor for Threaded<'a> {
149
149
} )
150
150
}
151
151
152
- fn completed ( & self ) -> Box < dyn Iterator < Item = CompletedIO > + ' _ > {
152
+ fn completed ( & self ) -> Box < dyn Iterator < Item = CompletedIo > + ' _ > {
153
153
Box :: new ( JoinIterator {
154
154
iter : self . rx . try_iter ( ) ,
155
155
consume_sentinel : true ,
@@ -174,9 +174,9 @@ struct JoinIterator<T: Iterator<Item = Task>> {
174
174
}
175
175
176
176
impl < T : Iterator < Item = Task > > Iterator for JoinIterator < T > {
177
- type Item = CompletedIO ;
177
+ type Item = CompletedIo ;
178
178
179
- fn next ( & mut self ) -> Option < CompletedIO > {
179
+ fn next ( & mut self ) -> Option < CompletedIo > {
180
180
let task_o = self . iter . next ( ) ;
181
181
match task_o {
182
182
None => None ,
@@ -200,9 +200,9 @@ struct SubmitIterator<'a, 'b> {
200
200
}
201
201
202
202
impl < ' a , ' b > Iterator for SubmitIterator < ' a , ' b > {
203
- type Item = CompletedIO ;
203
+ type Item = CompletedIo ;
204
204
205
- fn next ( & mut self ) -> Option < CompletedIO > {
205
+ fn next ( & mut self ) -> Option < CompletedIo > {
206
206
// The number here is arbitrary; just a number to stop exhausting fd's on linux
207
207
// and still allow rapid decompression to generate work to dispatch
208
208
// This function could perhaps be tuned: e.g. it may wait in rx.iter()
0 commit comments