@@ -136,18 +136,18 @@ impl<'a> CodeWriter<'a> {
136
136
}
137
137
138
138
pub fn field_entry ( & mut self , name : & str , value : & str ) {
139
- self . write_line ( & format ! ( "{name}: {value}," ) ) ;
139
+ self . write_line ( format ! ( "{name}: {value}," ) ) ;
140
140
}
141
141
142
142
pub fn field_decl ( & mut self , name : & str , field_type : & str ) {
143
- self . write_line ( & format ! ( "{name}: {field_type}," ) ) ;
143
+ self . write_line ( format ! ( "{name}: {field_type}," ) ) ;
144
144
}
145
145
146
146
pub fn comment ( & mut self , comment : & str ) {
147
147
if comment. is_empty ( ) {
148
148
self . write_line ( "//" ) ;
149
149
} else {
150
- self . write_line ( & format ! ( "// {comment}" ) ) ;
150
+ self . write_line ( format ! ( "// {comment}" ) ) ;
151
151
}
152
152
}
153
153
@@ -397,15 +397,15 @@ impl<'a> MethodGen<'a> {
397
397
// Unary
398
398
MethodType :: Unary => {
399
399
w. pub_fn ( & self . unary_opt ( & method_name) , |w| {
400
- w. write_line ( & format ! (
400
+ w. write_line ( format ! (
401
401
"self.client.unary_call(&{}, req, opt)" ,
402
402
self . const_method_name( )
403
403
) ) ;
404
404
} ) ;
405
405
w. write_line ( "" ) ;
406
406
407
407
w. pub_fn ( & self . unary ( & method_name) , |w| {
408
- w. write_line ( & format ! (
408
+ w. write_line ( format ! (
409
409
"self.{}_opt(req, {})" ,
410
410
method_name,
411
411
fq_grpc( "CallOption::default()" )
@@ -414,15 +414,15 @@ impl<'a> MethodGen<'a> {
414
414
w. write_line ( "" ) ;
415
415
416
416
w. pub_fn ( & self . unary_async_opt ( & method_name) , |w| {
417
- w. write_line ( & format ! (
417
+ w. write_line ( format ! (
418
418
"self.client.unary_call_async(&{}, req, opt)" ,
419
419
self . const_method_name( )
420
420
) ) ;
421
421
} ) ;
422
422
w. write_line ( "" ) ;
423
423
424
424
w. pub_fn ( & self . unary_async ( & method_name) , |w| {
425
- w. write_line ( & format ! (
425
+ w. write_line ( format ! (
426
426
"self.{}_async_opt(req, {})" ,
427
427
method_name,
428
428
fq_grpc( "CallOption::default()" )
@@ -433,15 +433,15 @@ impl<'a> MethodGen<'a> {
433
433
// Client streaming
434
434
MethodType :: ClientStreaming => {
435
435
w. pub_fn ( & self . client_streaming_opt ( & method_name) , |w| {
436
- w. write_line ( & format ! (
436
+ w. write_line ( format ! (
437
437
"self.client.client_streaming(&{}, opt)" ,
438
438
self . const_method_name( )
439
439
) ) ;
440
440
} ) ;
441
441
w. write_line ( "" ) ;
442
442
443
443
w. pub_fn ( & self . client_streaming ( & method_name) , |w| {
444
- w. write_line ( & format ! (
444
+ w. write_line ( format ! (
445
445
"self.{}_opt({})" ,
446
446
method_name,
447
447
fq_grpc( "CallOption::default()" )
@@ -452,15 +452,15 @@ impl<'a> MethodGen<'a> {
452
452
// Server streaming
453
453
MethodType :: ServerStreaming => {
454
454
w. pub_fn ( & self . server_streaming_opt ( & method_name) , |w| {
455
- w. write_line ( & format ! (
455
+ w. write_line ( format ! (
456
456
"self.client.server_streaming(&{}, req, opt)" ,
457
457
self . const_method_name( )
458
458
) ) ;
459
459
} ) ;
460
460
w. write_line ( "" ) ;
461
461
462
462
w. pub_fn ( & self . server_streaming ( & method_name) , |w| {
463
- w. write_line ( & format ! (
463
+ w. write_line ( format ! (
464
464
"self.{}_opt(req, {})" ,
465
465
method_name,
466
466
fq_grpc( "CallOption::default()" )
@@ -471,15 +471,15 @@ impl<'a> MethodGen<'a> {
471
471
// Duplex streaming
472
472
MethodType :: Duplex => {
473
473
w. pub_fn ( & self . duplex_streaming_opt ( & method_name) , |w| {
474
- w. write_line ( & format ! (
474
+ w. write_line ( format ! (
475
475
"self.client.duplex_streaming(&{}, opt)" ,
476
476
self . const_method_name( )
477
477
) ) ;
478
478
} ) ;
479
479
w. write_line ( "" ) ;
480
480
481
481
w. pub_fn ( & self . duplex_streaming ( & method_name) , |w| {
482
- w. write_line ( & format ! (
482
+ w. write_line ( format ! (
483
483
"self.{}_opt({})" ,
484
484
method_name,
485
485
fq_grpc( "CallOption::default()" )
@@ -526,7 +526,7 @@ impl<'a> MethodGen<'a> {
526
526
) ,
527
527
"});" ,
528
528
|w| {
529
- w. write_line ( & format ! ( "instance.{}(ctx, req, resp)" , self . name( ) ) ) ;
529
+ w. write_line ( format ! ( "instance.{}(ctx, req, resp)" , self . name( ) ) ) ;
530
530
} ,
531
531
) ;
532
532
}
0 commit comments