Skip to content

Commit

Permalink
feat: use afit to optimize gen code
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWhiteWu committed Oct 21, 2023
1 parent d669325 commit dcd9eb7
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 40 deletions.
77 changes: 54 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions pilota-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota-build"
version = "0.8.6"
version = "0.9.0"
edition = "2021"
description = "Compile thrift and protobuf idl into rust code at compile-time."
documentation = "https://docs.rs/pilota-build"
Expand All @@ -17,9 +17,9 @@ keywords = ["serialization", "thrift", "protobuf", "volo"]
maintenance = { status = "actively-developed" }

[dependencies]
pilota-thrift-parser = { path = "../pilota-thrift-parser", version = "0.4" }
pilota-thrift-parser = { path = "../pilota-thrift-parser", version = "0.9" }

toml = "0.7"
toml = "0.8"
heck = "0.4"
syn = "2"
normpath = "1"
Expand All @@ -36,7 +36,7 @@ tracing = "0.1"
dashmap = "5"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
phf = { version = "0.11", features = ["macros"] }
itertools = "0.10"
itertools = "0.11"
paste = "1"
petgraph = "0.6"
anyhow = "1"
Expand All @@ -47,9 +47,6 @@ protobuf-parse = { package = "protobuf-parse2", version = "4.0.0-alpha.3" }
protobuf = { package = "protobuf2", version = "4.0.0-alpha.2" }
faststr = "0.2"

[build-dependencies]
itertools = "0.10"

[dev-dependencies]
async-trait = "0.1"
pilota = { path = "../pilota" }
Expand Down
1 change: 0 additions & 1 deletion pilota-build/src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ where

stream.push_str(&format! {
r#"
#[::async_trait::async_trait]
pub trait {name} {{
{methods}
}}
Expand Down
1 change: 0 additions & 1 deletion pilota-build/test_data/protobuf/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub mod service {
}
}

#[::async_trait::async_trait]
pub trait Echo {}
#[derive(PartialOrd, Hash, Eq, Ord, Debug, Default, Clone, PartialEq)]
pub struct EchoResponse {
Expand Down
1 change: 0 additions & 1 deletion pilota-build/test_data/thrift/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ pub mod normal {
+ protocol.struct_end_len()
}
}
#[::async_trait::async_trait]
pub trait Test {}
#[derive(PartialOrd, Hash, Eq, Ord, Debug, Default, Clone, PartialEq)]
pub struct TestTest123ArgsSend {}
Expand Down
1 change: 0 additions & 1 deletion pilota-build/test_data/thrift/pilota_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ pub mod pilota_name {
}
}
pub const LANG_ID: &'static str = "id";
#[::async_trait::async_trait]
pub trait TestService {}
#[derive(PartialOrd, Hash, Eq, Ord, Debug, ::pilota::derivative::Derivative)]
#[derivative(Default)]
Expand Down
1 change: 0 additions & 1 deletion pilota-build/test_data/thrift/void.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ pub mod void {
+ protocol.struct_end_len()
}
}
#[::async_trait::async_trait]
pub trait Test {}
}
}
1 change: 0 additions & 1 deletion pilota-build/test_data/thrift/wrapper_arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ pub mod wrapper_arc {
+ protocol.struct_end_len()
}
}
#[::async_trait::async_trait]
pub trait TestService {}
#[derive(Debug, ::pilota::derivative::Derivative)]
#[derivative(Default)]
Expand Down
2 changes: 0 additions & 2 deletions pilota-build/test_data/unknown_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ pub mod unknown_fields {
+ protocol.struct_end_len()
}
}
#[::async_trait::async_trait]
pub trait Test {}
#[derive(
PartialOrd,
Expand Down Expand Up @@ -3462,7 +3461,6 @@ pub mod unknown_fields {

pub mod void {

#[::async_trait::async_trait]
pub trait Test {}
#[derive(PartialOrd, Hash, Eq, Ord, Debug, ::pilota::derivative::Derivative)]
#[derivative(Default)]
Expand Down
2 changes: 1 addition & 1 deletion pilota-thrift-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota-thrift-parser"
version = "0.4.2"
version = "0.9.0"
edition = "2021"
description = "Pilota thrift Parser."
documentation = "https://docs.rs/pilota"
Expand Down
2 changes: 1 addition & 1 deletion pilota/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota"
version = "0.8.1"
version = "0.9.0"
edition = "2021"
description = "Pilota is a thrift and protobuf implementation in pure rust with high performance and extensibility."
documentation = "https://docs.rs/pilota"
Expand Down

0 comments on commit dcd9eb7

Please sign in to comment.