Skip to content

Commit 4d37832

Browse files
committed
feat: support generate Arc<Req> for service
1 parent 18ee8b1 commit 4d37832

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

volo-build/src/thrift_backend.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,16 @@ impl pilota_build::CodegenBackend for VoloThriftBackend {
756756
.map(|a| {
757757
let ty = self.inner.codegen_item_ty(a.ty.kind.clone());
758758
let ident = self.cx().rust_name(a.def_id); // use the rust name as string format which will escape the keyword
759+
let ty = if let Some(RustWrapperArc(true)) = self
760+
.cx()
761+
.tags(a.tags_id)
762+
.as_ref()
763+
.and_then(|tags| tags.get::<RustWrapperArc>())
764+
{
765+
format!("::std::sync::Arc<{ty}>")
766+
} else {
767+
format!("{ty}")
768+
};
759769
let ty = if a.kind == rir::FieldKind::Optional {
760770
format!("::std::option::Option<{ty}>")
761771
} else {

0 commit comments

Comments
 (0)