File tree 1 file changed +3
-9
lines changed
src/tools/rust-installer/src
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -214,22 +214,16 @@ impl Write for CombinedEncoder {
214
214
}
215
215
216
216
fn write_all ( & mut self , buf : & [ u8 ] ) -> std:: io:: Result < ( ) > {
217
- self . encoders
218
- . par_iter_mut ( )
219
- . map ( |w| w. write_all ( buf) )
220
- . collect :: < std:: io:: Result < Vec < ( ) > > > ( ) ?;
221
- Ok ( ( ) )
217
+ self . encoders . par_iter_mut ( ) . try_for_each ( |w| w. write_all ( buf) )
222
218
}
223
219
224
220
fn flush ( & mut self ) -> std:: io:: Result < ( ) > {
225
- self . encoders . par_iter_mut ( ) . map ( |w| w. flush ( ) ) . collect :: < std:: io:: Result < Vec < ( ) > > > ( ) ?;
226
- Ok ( ( ) )
221
+ self . encoders . par_iter_mut ( ) . try_for_each ( Write :: flush)
227
222
}
228
223
}
229
224
230
225
impl Encoder for CombinedEncoder {
231
226
fn finish ( self : Box < Self > ) -> Result < ( ) , Error > {
232
- self . encoders . into_par_iter ( ) . map ( |e| e. finish ( ) ) . collect :: < Result < Vec < ( ) > , Error > > ( ) ?;
233
- Ok ( ( ) )
227
+ self . encoders . into_par_iter ( ) . try_for_each ( Encoder :: finish)
234
228
}
235
229
}
You can’t perform that action at this time.
0 commit comments