@@ -254,17 +254,17 @@ macro_rules! define_client_side {
254
254
$( impl $name {
255
255
$( pub ( crate ) fn $method( $( $arg: $arg_ty) ,* ) $( -> $ret_ty) * {
256
256
Bridge :: with( |bridge| {
257
- let mut b = bridge. cached_buffer. take( ) ;
257
+ let mut buf = bridge. cached_buffer. take( ) ;
258
258
259
- b . clear( ) ;
260
- api_tags:: Method :: $name( api_tags:: $name:: $method) . encode( & mut b , & mut ( ) ) ;
261
- reverse_encode!( b ; $( $arg) ,* ) ;
259
+ buf . clear( ) ;
260
+ api_tags:: Method :: $name( api_tags:: $name:: $method) . encode( & mut buf , & mut ( ) ) ;
261
+ reverse_encode!( buf ; $( $arg) ,* ) ;
262
262
263
- b = bridge. dispatch. call( b ) ;
263
+ buf = bridge. dispatch. call( buf ) ;
264
264
265
- let r = Result :: <_, PanicMessage >:: decode( & mut & b [ ..] , & mut ( ) ) ;
265
+ let r = Result :: <_, PanicMessage >:: decode( & mut & buf [ ..] , & mut ( ) ) ;
266
266
267
- bridge. cached_buffer = b ;
267
+ bridge. cached_buffer = buf ;
268
268
269
269
r. unwrap_or_else( |e| panic:: resume_unwind( e. into( ) ) )
270
270
} )
@@ -383,20 +383,20 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
383
383
f : impl FnOnce ( A ) -> R ,
384
384
) -> Buffer {
385
385
// The initial `cached_buffer` contains the input.
386
- let mut b = bridge. cached_buffer . take ( ) ;
386
+ let mut buf = bridge. cached_buffer . take ( ) ;
387
387
388
388
panic:: catch_unwind ( panic:: AssertUnwindSafe ( || {
389
389
bridge. enter ( || {
390
- let reader = & mut & b [ ..] ;
390
+ let reader = & mut & buf [ ..] ;
391
391
let input = A :: decode ( reader, & mut ( ) ) ;
392
392
393
393
// Put the `cached_buffer` back in the `Bridge`, for requests.
394
- Bridge :: with ( |bridge| bridge. cached_buffer = b . take ( ) ) ;
394
+ Bridge :: with ( |bridge| bridge. cached_buffer = buf . take ( ) ) ;
395
395
396
396
let output = f ( input) ;
397
397
398
398
// Take the `cached_buffer` back out, for the output value.
399
- b = Bridge :: with ( |bridge| bridge. cached_buffer . take ( ) ) ;
399
+ buf = Bridge :: with ( |bridge| bridge. cached_buffer . take ( ) ) ;
400
400
401
401
// HACK(eddyb) Separate encoding a success value (`Ok(output)`)
402
402
// from encoding a panic (`Err(e: PanicMessage)`) to avoid
@@ -407,16 +407,16 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
407
407
// this is defensively trying to avoid any accidental panicking
408
408
// reaching the `extern "C"` (which should `abort` but might not
409
409
// at the moment, so this is also potentially preventing UB).
410
- b . clear ( ) ;
411
- Ok :: < _ , ( ) > ( output) . encode ( & mut b , & mut ( ) ) ;
410
+ buf . clear ( ) ;
411
+ Ok :: < _ , ( ) > ( output) . encode ( & mut buf , & mut ( ) ) ;
412
412
} )
413
413
} ) )
414
414
. map_err ( PanicMessage :: from)
415
415
. unwrap_or_else ( |e| {
416
- b . clear ( ) ;
417
- Err :: < ( ) , _ > ( e) . encode ( & mut b , & mut ( ) ) ;
416
+ buf . clear ( ) ;
417
+ Err :: < ( ) , _ > ( e) . encode ( & mut buf , & mut ( ) ) ;
418
418
} ) ;
419
- b
419
+ buf
420
420
}
421
421
422
422
impl Client < fn ( crate :: TokenStream ) -> crate :: TokenStream > {
0 commit comments