@@ -160,7 +160,7 @@ pub fn get_input(config: &Config) -> UResult<Box<dyn Read>> {
160160 }
161161}
162162
163- pub fn handle_input < R : Read > ( input : & mut R , format : Format , config : Config ) -> UResult < ( ) > {
163+ pub fn handle_input ( input : & mut dyn Read , format : Format , config : Config ) -> UResult < ( ) > {
164164 let supports_fast_decode_and_encode = get_supports_fast_decode_and_encode ( format) ;
165165
166166 let supports_fast_decode_and_encode_ref = supports_fast_decode_and_encode. as_ref ( ) ;
@@ -377,13 +377,13 @@ pub mod fast_encode {
377377 }
378378
379379 fn write_to_output (
380- line_wrapping_option : & mut Option < LineWrapping > ,
380+ line_wrapping : & mut Option < LineWrapping > ,
381381 encoded_buffer : & mut VecDeque < u8 > ,
382382 output : & mut dyn Write ,
383383 is_cleanup : bool ,
384384 ) -> io:: Result < ( ) > {
385385 // Write all data in `encoded_buffer` to `output`
386- if let & mut Some ( ref mut li) = line_wrapping_option {
386+ if let & mut Some ( ref mut li) = line_wrapping {
387387 write_with_line_breaks ( li, encoded_buffer, output, is_cleanup) ?;
388388 } else {
389389 write_without_line_breaks ( encoded_buffer, output, is_cleanup) ?;
@@ -393,9 +393,9 @@ pub mod fast_encode {
393393 }
394394 // End of helper functions
395395
396- pub fn fast_encode < R : Read , W : Write > (
397- input : & mut R ,
398- mut output : W ,
396+ pub fn fast_encode (
397+ input : & mut dyn Read ,
398+ output : & mut dyn Write ,
399399 supports_fast_decode_and_encode : & dyn SupportsFastDecodeAndEncode ,
400400 wrap : Option < usize > ,
401401 ) -> UResult < ( ) > {
@@ -475,14 +475,14 @@ pub mod fast_encode {
475475 assert ! ( leftover_buffer. len( ) < encode_in_chunks_of_size) ;
476476
477477 // Write all data in `encoded_buffer` to `output`
478- write_to_output ( & mut line_wrapping, & mut encoded_buffer, & mut output, false ) ?;
478+ write_to_output ( & mut line_wrapping, & mut encoded_buffer, output, false ) ?;
479479 }
480480 Err ( er) => {
481481 let kind = er. kind ( ) ;
482482
483483 if kind == ErrorKind :: Interrupted {
484- // TODO
485- // Retry reading?
484+ // Retry reading
485+ continue ;
486486 }
487487
488488 return Err ( USimpleError :: new ( 1 , format_read_error ( kind) ) ) ;
@@ -499,7 +499,7 @@ pub mod fast_encode {
499499
500500 // Write all data in `encoded_buffer` to output
501501 // `is_cleanup` triggers special cleanup-only logic
502- write_to_output ( & mut line_wrapping, & mut encoded_buffer, & mut output, true ) ?;
502+ write_to_output ( & mut line_wrapping, & mut encoded_buffer, output, true ) ?;
503503 }
504504
505505 Ok ( ( ) )
@@ -606,9 +606,9 @@ pub mod fast_decode {
606606 }
607607 // End of helper functions
608608
609- pub fn fast_decode < R : Read , W : Write > (
610- input : & mut R ,
611- mut output : & mut W ,
609+ pub fn fast_decode (
610+ input : & mut dyn Read ,
611+ output : & mut dyn Write ,
612612 supports_fast_decode_and_encode : & dyn SupportsFastDecodeAndEncode ,
613613 ignore_garbage : bool ,
614614 ) -> UResult < ( ) > {
@@ -711,14 +711,14 @@ pub mod fast_decode {
711711 assert ! ( leftover_buffer. len( ) < decode_in_chunks_of_size) ;
712712
713713 // Write all data in `decoded_buffer` to `output`
714- write_to_output ( & mut decoded_buffer, & mut output) ?;
714+ write_to_output ( & mut decoded_buffer, output) ?;
715715 }
716716 Err ( er) => {
717717 let kind = er. kind ( ) ;
718718
719719 if kind == ErrorKind :: Interrupted {
720- // TODO
721- // Retry reading?
720+ // Retry reading
721+ continue ;
722722 }
723723
724724 return Err ( USimpleError :: new ( 1 , format_read_error ( kind) ) ) ;
@@ -734,7 +734,7 @@ pub mod fast_decode {
734734 . decode_into_vec ( & leftover_buffer, & mut decoded_buffer) ?;
735735
736736 // Write all data in `decoded_buffer` to `output`
737- write_to_output ( & mut decoded_buffer, & mut output) ?;
737+ write_to_output ( & mut decoded_buffer, output) ?;
738738 }
739739
740740 Ok ( ( ) )
0 commit comments