Skip to content

Commit

Permalink
Merge pull request #164 from Tim-Zhang/fix-optional-0.6.0
Browse files Browse the repository at this point in the history
[0.6.0] ttrpc-codegen: Fix proto3's optional support
  • Loading branch information
lifupan authored Oct 14, 2022
2 parents 5a18aa1 + a42b31c commit 92cfa7f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ homepage = "https://github.com/containerd/ttrpc-rust"
description = "A Rust version of ttrpc."

[dependencies]
protobuf = { version = "2.27.1" }
protobuf = { version = "2.28.0" }
libc = { version = "0.2.59", features = [ "extra_traits" ] }
nix = "0.23.0"
log = "0.4"
Expand All @@ -26,7 +26,7 @@ futures = { version = "0.3", optional = true }
tokio-vsock = { version = "0.3.1", optional = true }

[build-dependencies]
protobuf-codegen-pure = "2.27.1"
protobuf-codegen-pure = "2.28.0"

[features]
default = ["sync"]
Expand Down
4 changes: 2 additions & 2 deletions compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ homepage = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
readme = "README.md"

[dependencies]
protobuf = "2.27.1"
protobuf-codegen = "2.27.1"
protobuf = "2.28.0"
protobuf-codegen = "2.28.0"
prost = "0.8"
prost-build = "0.8"
prost-types = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ homepage = "https://github.com/alipay/ttrpc-rust"
description = "An example of ttrpc."

[dev-dependencies]
protobuf = "2.27.1"
protobuf = "2.28.0"
bytes = "0.4.11"
libc = "0.2.79"
byteorder = "1.3.2"
Expand Down
8 changes: 4 additions & 4 deletions ttrpc-codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ttrpc-codegen"
version = "0.3.1"
version = "0.3.2"
edition = "2018"
authors = ["The AntFin Kata Team <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -13,8 +13,8 @@ readme = "README.md"


[dependencies]
protobuf = "2.27.1"
protobuf-codegen = "2.27.1"
protobuf = "2.28.0"
protobuf-codegen = "2.28.0"
# protobuf-codegen-pure3 is a protobuf-codegen-pure version that supports proto3 optional fields
protobuf-codegen-pure = { version = "2.27.3", package = "protobuf-codegen-pure3" }
protobuf-codegen-pure = { version = "2.28.1", package = "protobuf-codegen-pure3" }
ttrpc-compiler = "0.5.0"
7 changes: 1 addition & 6 deletions ttrpc-codegen/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,7 @@ impl<'a> Lexer<'a> {
}

fn next_char_if_in(&mut self, alphabet: &str) -> Option<char> {
for c in alphabet.chars() {
if self.next_char_if_eq(c) {
return Some(c);
}
}
None
alphabet.chars().find(|&c| self.next_char_if_eq(c))
}

fn next_char_expect_eq(&mut self, expect: char) -> ParserResult<()> {
Expand Down

0 comments on commit 92cfa7f

Please sign in to comment.