94
94
tendril. pop_back ( BUFFER_SIZE - n as u32 ) ;
95
95
self . process ( tendril) ;
96
96
break ;
97
- }
98
- Err ( ref e) if e. kind ( ) == io:: ErrorKind :: Interrupted => { }
97
+ } ,
98
+ Err ( ref e) if e. kind ( ) == io:: ErrorKind :: Interrupted => { } ,
99
99
Err ( e) => return Err ( e) ,
100
100
}
101
101
}
@@ -162,15 +162,15 @@ where
162
162
self . inner_sink . error ( "invalid byte sequence" . into ( ) ) ;
163
163
self . inner_sink
164
164
. process ( Tendril :: from_slice ( utf8:: REPLACEMENT_CHARACTER ) ) ;
165
- }
165
+ } ,
166
166
}
167
167
t. len ( ) - rest. len ( )
168
168
} ) ;
169
169
match resume_at {
170
170
None => {
171
171
self . incomplete = Some ( incomplete) ;
172
172
return ;
173
- }
173
+ } ,
174
174
Some ( resume_at) => t. pop_front ( resume_at as u32 ) ,
175
175
}
176
176
}
@@ -180,7 +180,7 @@ where
180
180
debug_assert ! ( s. as_ptr( ) == t. as_ptr( ) ) ;
181
181
debug_assert ! ( s. len( ) == t. len( ) ) ;
182
182
Ok ( ( ) )
183
- }
183
+ } ,
184
184
Err ( utf8:: DecodeError :: Invalid {
185
185
valid_prefix,
186
186
invalid_sequence,
@@ -192,21 +192,21 @@ where
192
192
valid_prefix. len ( ) ,
193
193
Err ( valid_prefix. len ( ) + invalid_sequence. len ( ) ) ,
194
194
) )
195
- }
195
+ } ,
196
196
Err ( utf8:: DecodeError :: Incomplete {
197
197
valid_prefix,
198
198
incomplete_suffix,
199
199
} ) => {
200
200
debug_assert ! ( valid_prefix. as_ptr( ) == t. as_ptr( ) ) ;
201
201
debug_assert ! ( valid_prefix. len( ) <= t. len( ) ) ;
202
202
Err ( ( valid_prefix. len ( ) , Ok ( incomplete_suffix) ) )
203
- }
203
+ } ,
204
204
} ;
205
205
match unborrowed_result {
206
206
Ok ( ( ) ) => {
207
207
unsafe { self . inner_sink . process ( t. reinterpret_without_validating ( ) ) }
208
208
return ;
209
- }
209
+ } ,
210
210
Err ( ( valid_len, and_then) ) => {
211
211
if valid_len > 0 {
212
212
let subtendril = t. subtendril ( 0 , valid_len as u32 ) ;
@@ -219,15 +219,15 @@ where
219
219
Ok ( incomplete) => {
220
220
self . incomplete = Some ( incomplete) ;
221
221
return ;
222
- }
222
+ } ,
223
223
Err ( offset) => {
224
224
self . inner_sink . error ( "invalid byte sequence" . into ( ) ) ;
225
225
self . inner_sink
226
226
. process ( Tendril :: from_slice ( utf8:: REPLACEMENT_CHARACTER ) ) ;
227
227
t. pop_front ( offset as u32 ) ;
228
- }
228
+ } ,
229
229
}
230
- }
230
+ } ,
231
231
}
232
232
}
233
233
}
@@ -365,21 +365,21 @@ where
365
365
debug_assert ! ( err. upto >= 0 ) ;
366
366
t. pop_front ( err. upto as u32 ) ;
367
367
// continue loop and process remainder of t
368
- }
368
+ } ,
369
369
( _, None ) => break ,
370
370
}
371
371
}
372
372
if out. len ( ) > 0 {
373
373
sink. process ( out) ;
374
374
}
375
- }
375
+ } ,
376
376
#[ cfg( feature = "encoding_rs" ) ]
377
377
LossyDecoderInner :: EncodingRs ( ref mut decoder, ref mut sink) => {
378
378
if t. is_empty ( ) {
379
379
return ;
380
380
}
381
381
decode_to_sink ( t, decoder, sink, false ) ;
382
- }
382
+ } ,
383
383
}
384
384
}
385
385
@@ -411,12 +411,12 @@ where
411
411
sink. process ( out) ;
412
412
}
413
413
sink. finish ( )
414
- }
414
+ } ,
415
415
#[ cfg( feature = "encoding_rs" ) ]
416
416
LossyDecoderInner :: EncodingRs ( mut decoder, mut sink) => {
417
417
decode_to_sink ( Tendril :: new ( ) , & mut decoder, & mut sink, true ) ;
418
418
sink. finish ( )
419
- }
419
+ } ,
420
420
}
421
421
}
422
422
}
@@ -449,11 +449,11 @@ fn decode_to_sink<Sink, A>(
449
449
}
450
450
match result {
451
451
DecoderResult :: InputEmpty => return ,
452
- DecoderResult :: OutputFull => { }
452
+ DecoderResult :: OutputFull => { } ,
453
453
DecoderResult :: Malformed ( _, _) => {
454
454
sink. error ( Cow :: Borrowed ( "invalid sequence" ) ) ;
455
455
sink. process ( "\u{FFFD} " . into ( ) ) ;
456
- }
456
+ } ,
457
457
}
458
458
t. pop_front ( bytes_read as u32 ) ;
459
459
if t. is_empty ( ) {
0 commit comments