Commit f9ebb9b
committed
compiler: write_async_server_create: Fix no methods mut issue
Got follow build issue with a service that doesn't have normal methods
and just has stream methods:
error: variable does not need to be mutable
-->
/home/t4/teawater/coco/kata-containers/src/libs/protocols/src/attestation_agent_ttrpc.rs:60:9
|
60 | let mut methods = HashMap::new();
| ----^^^^^^^
| |
| help: remove this `mut`
|
= note: `-D unused-mut` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_mut)]`
The reason is the code that generate from proto file is:
let mut methods = HashMap::new();
let mut streams = HashMap::new();
streams.insert("ContainerEventsStream".to_string(),
Arc::new(ContainerEventsStreamMethod{service:
service.clone()}) as Arc<dyn ::ttrpc::r#async::StreamHandler + Send +
Sync>);
ret.insert("grpc.AttestationAgent".to_string(),
::ttrpc::r#async::Service{ methods, streams });
ret
This commit update function write_async_server_create to handle this
issue.
Fixes: #273
Signed-off-by: Hui Zhu <teawater@antgroup.com>1 parent b3b66bf commit f9ebb9b
1 file changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
489 | 495 | | |
490 | 496 | | |
491 | 497 | | |
| |||
588 | 594 | | |
589 | 595 | | |
590 | 596 | | |
| 597 | + | |
591 | 598 | | |
592 | 599 | | |
593 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
594 | 605 | | |
595 | 606 | | |
596 | 607 | | |
| |||
0 commit comments