Skip to content

Commit

Permalink
feata: compilance with proto official standards, see: https://protobu…
Browse files Browse the repository at this point in the history
  • Loading branch information
masai.dss committed Nov 29, 2024
1 parent 8fd210d commit caa32e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions prost-reflect/src/dynamic/text_format/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,13 @@ impl<'a> Parser<'a> {

fn parse_bool(&mut self) -> Result<(bool, Span), ParseErrorKind> {
match self.peek()? {
Some((Token::Ident("false"), _)) => Ok((false, self.bump())),
Some((Token::Ident("true"), _)) => Ok((true, self.bump())),
Some((Token::Ident("false"), _))
| Some((Token::Ident("False"), _))
| Some((Token::Ident("f"), _)) => Ok((false, self.bump())),
Some((Token::Ident("true"), _))
| Some((Token::Ident("True"), _))
| Some((Token::Ident("t"), _)) => Ok((true, self.bump())),
Some((Token::IntLiteral(v), _)) => Ok((v.value == "1", self.bump())),
_ => self.unexpected_token("'true' or 'false'"),
}
}
Expand Down

0 comments on commit caa32e0

Please sign in to comment.