@@ -218,7 +218,7 @@ impl <P: BlockProcessor, X: PaddingProcessor> BlockEngine<P, X> {
218
218
// Finally, convert out_write_scratch into out_read_scratch.
219
219
fn process_scratch < P : BlockProcessor , X : PaddingProcessor > ( me : & mut BlockEngine < P , X > ) {
220
220
let mut rin = me. in_scratch . take_read_buffer ( ) ;
221
- let mut wout = me. out_write_scratch . take_unwrap ( ) ;
221
+ let mut wout = me. out_write_scratch . take ( ) . unwrap ( ) ;
222
222
223
223
{
224
224
let next_in = rin. take_remaining ( ) ;
@@ -280,7 +280,7 @@ impl <P: BlockProcessor, X: PaddingProcessor> BlockEngine<P, X> {
280
280
// The NeedOutput state just writes buffered processed data to the output stream
281
281
// until all of it has been written.
282
282
NeedOutput => {
283
- let mut rout = self . out_read_scratch . take_unwrap ( ) ;
283
+ let mut rout = self . out_read_scratch . take ( ) . unwrap ( ) ;
284
284
rout. push_to ( output) ;
285
285
if rout. is_empty ( ) {
286
286
self . out_write_scratch = Some ( rout. into_write_buffer ( ) ) ;
@@ -325,7 +325,7 @@ impl <P: BlockProcessor, X: PaddingProcessor> BlockEngine<P, X> {
325
325
self . padding . pad_input ( & mut self . in_scratch ) ;
326
326
if self . in_scratch . is_full ( ) {
327
327
process_scratch ( self ) ;
328
- if self . padding . strip_output ( self . out_read_scratch . get_mut_ref ( ) ) {
328
+ if self . padding . strip_output ( self . out_read_scratch . as_mut ( ) . unwrap ( ) ) {
329
329
self . state = Finished ;
330
330
} else {
331
331
self . state = Error ( InvalidPadding ) ;
@@ -341,7 +341,7 @@ impl <P: BlockProcessor, X: PaddingProcessor> BlockEngine<P, X> {
341
341
if self . in_scratch . is_full ( ) {
342
342
self . state = LastInput2 ;
343
343
} else if self . in_scratch . is_empty ( ) {
344
- if self . padding . strip_output ( self . out_read_scratch . get_mut_ref ( ) ) {
344
+ if self . padding . strip_output ( self . out_read_scratch . as_mut ( ) . unwrap ( ) ) {
345
345
self . state = Finished ;
346
346
} else {
347
347
self . state = Error ( InvalidPadding ) ;
@@ -356,12 +356,12 @@ impl <P: BlockProcessor, X: PaddingProcessor> BlockEngine<P, X> {
356
356
// of data in the case that the input was a multiple of the block size and the mode
357
357
// decided to add a full extra block of padding.
358
358
LastInput2 => {
359
- let mut rout = self . out_read_scratch . take_unwrap ( ) ;
359
+ let mut rout = self . out_read_scratch . take ( ) . unwrap ( ) ;
360
360
rout. push_to ( output) ;
361
361
if rout. is_empty ( ) {
362
362
self . out_write_scratch = Some ( rout. into_write_buffer ( ) ) ;
363
363
process_scratch ( self ) ;
364
- if self . padding . strip_output ( self . out_read_scratch . get_mut_ref ( ) ) {
364
+ if self . padding . strip_output ( self . out_read_scratch . as_mut ( ) . unwrap ( ) ) {
365
365
self . state = Finished ;
366
366
} else {
367
367
self . state = Error ( InvalidPadding ) ;
@@ -399,11 +399,11 @@ impl <P: BlockProcessor, X: PaddingProcessor> BlockEngine<P, X> {
399
399
self . state = FastMode ;
400
400
self . in_scratch . reset ( ) ;
401
401
if self . out_read_scratch . is_some ( ) {
402
- let ors = self . out_read_scratch . take_unwrap ( ) ;
402
+ let ors = self . out_read_scratch . take ( ) . unwrap ( ) ;
403
403
let ows = ors. into_write_buffer ( ) ;
404
404
self . out_write_scratch = Some ( ows) ;
405
405
} else {
406
- self . out_write_scratch . get_mut_ref ( ) . reset ( ) ;
406
+ self . out_write_scratch . as_mut ( ) . unwrap ( ) . reset ( ) ;
407
407
}
408
408
}
409
409
fn reset_with_history ( & mut self , in_hist : & [ u8 ] , out_hist : & [ u8 ] ) {
0 commit comments