Skip to content

Commit

Permalink
fix(pilota-thrift-parser): trim extra whitespace characters at the en…
Browse files Browse the repository at this point in the history
…d of annotation list
  • Loading branch information
Ggiggle committed Nov 3, 2024
1 parent b1078bc commit b72c5d7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

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.11.2"
version = "0.11.3"
edition = "2021"
description = "Pilota thrift Parser."
documentation = "https://docs.rs/pilota"
Expand Down
3 changes: 2 additions & 1 deletion pilota-thrift-parser/src/parser/annotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ impl Parser for Annotations {
Literal::parse,
opt(blank),
opt(list_separator),
opt(blank),
)),
|(_, p, _, _, _, lit, _, _)| Annotation {
|(_, p, _, _, _, lit, _, _, _)| Annotation {
key: p.to_owned(),
value: lit,
},
Expand Down
10 changes: 8 additions & 2 deletions pilota-thrift-parser/src/parser/struct_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ mod tests {
let str = r#"struct ImMsgContent {
1: string user_id (go.tag = 'json:\"user_id,omitempty\"'),
2: string __files (go.tag = 'json:\"__files,omitempty\"'),
}"#;
Struct::parse(str).unwrap();
}
(
cpp.type = "DenseFoo",
python.type = "DenseFoo",
java.final = "",
)"#;
let (remain, _) = Struct::parse(str).unwrap();
assert!(remain.is_empty());
}

#[test]
Expand Down

0 comments on commit b72c5d7

Please sign in to comment.