You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
0 commit comments