File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -201,12 +201,11 @@ pub mod tests {
201
201
202
202
fn chunked_encode_str ( bytes : & [ u8 ] , config : FastPortableConfig ) -> String {
203
203
let mut s = String :: new ( ) ;
204
- {
205
- let mut sink = StringSink :: from ( & mut s) ;
206
- let engine = FastPortable :: from ( & STANDARD , config) ;
207
- let encoder = ChunkedEncoder :: from ( & engine) ;
208
- encoder. encode ( bytes, & mut sink) . unwrap ( ) ;
209
- }
204
+
205
+ let mut sink = StringSink :: from ( & mut s) ;
206
+ let engine = FastPortable :: from ( & STANDARD , config) ;
207
+ let encoder = ChunkedEncoder :: from ( & engine) ;
208
+ encoder. encode ( bytes, & mut sink) . unwrap ( ) ;
210
209
211
210
s
212
211
}
@@ -222,10 +221,8 @@ pub mod tests {
222
221
fn encode_to_string < E : Engine > ( & self , engine : & E , bytes : & [ u8 ] ) -> String {
223
222
let encoder = ChunkedEncoder :: from ( engine) ;
224
223
let mut s = String :: new ( ) ;
225
- {
226
- let mut sink = StringSink :: from ( & mut s) ;
227
- encoder. encode ( bytes, & mut sink) . unwrap ( ) ;
228
- }
224
+ let mut sink = StringSink :: from ( & mut s) ;
225
+ encoder. encode ( bytes, & mut sink) . unwrap ( ) ;
229
226
230
227
s
231
228
}
Original file line number Diff line number Diff line change @@ -162,11 +162,8 @@ pub fn decode_engine_vec<E: Engine, T: AsRef<[u8]>>(
162
162
. expect ( "Overflow when calculating output buffer length" ) ;
163
163
buffer. resize ( total_len_estimate, 0 ) ;
164
164
165
- let bytes_written;
166
- {
167
- let buffer_slice = & mut buffer. as_mut_slice ( ) [ starting_output_len..] ;
168
- bytes_written = engine. decode ( input_bytes, buffer_slice, estimate) ?;
169
- }
165
+ let buffer_slice = & mut buffer. as_mut_slice ( ) [ starting_output_len..] ;
166
+ let bytes_written = engine. decode ( input_bytes, buffer_slice, estimate) ?;
170
167
171
168
buffer. truncate ( starting_output_len + bytes_written) ;
172
169
You can’t perform that action at this time.
0 commit comments