From 83fa95021c54a56d0f0674d2b59b527d0a6817a2 Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Mon, 19 Aug 2024 17:09:04 +0800 Subject: [PATCH] Codegen: convert Arc> to Arc This commit changes the generated ttrpc server from Arc> to Arc. This helps the type conversion and also avoids extra runtime cost caused by double pointer. Fixes #234 Signed-off-by: Xynnn007 --- compiler/src/codegen.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/codegen.rs b/compiler/src/codegen.rs index 382f5ae..e8b50dd 100644 --- a/compiler/src/codegen.rs +++ b/compiler/src/codegen.rs @@ -145,7 +145,7 @@ impl<'a> MethodGen<'a> { "}", |w| { w.write_line(&format!( - "service: Arc>,", + "service: Arc,", self.service_name )); }, @@ -577,7 +577,7 @@ impl<'a> ServiceGen<'a> { fn write_async_server_create(&self, w: &mut CodeWriter) { let s = format!( - "create_{}(service: Arc>) -> HashMap", + "create_{}(service: Arc) -> HashMap", to_snake_case(&self.service_name()), self.service_name(), "::ttrpc::r#async::Service"