Skip to content

Commit

Permalink
Fix formatting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Feb 16, 2024
1 parent 3fc5ad7 commit b484d8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
8 changes: 4 additions & 4 deletions protobuf-parse/src/pure/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl<'a> Resolver<'a> {
.iter()
.map(|v| self.enum_value(scope, &v))
.collect::<Result<_, _>>()?;

for reserved in &input.reserved_nums {
let mut reserved_range = EnumReservedRange::new();
reserved_range.set_start(*reserved.start());
Expand All @@ -536,9 +536,9 @@ impl<'a> Resolver<'a> {
reserved_range.set_end(*reserved.end());
output.reserved_range.push(reserved_range);
}
output.reserved_name = input.reserved_names.clone().into();

output.reserved_name = input.reserved_names.clone().into();

Ok(output)
}

Expand Down
1 change: 0 additions & 1 deletion protobuf-parse/src/pure/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ pub(crate) enum FieldOrOneOf {
OneOf(OneOf),
}


/// A protobuf message
#[derive(Debug, Clone, Default)]
pub(crate) struct Message {
Expand Down
21 changes: 5 additions & 16 deletions protobuf-parse/src/pure/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::ops::{RangeInclusive};
use std::ops::RangeInclusive;
use std::str;

use protobuf_support::lexer::int;
Expand Down Expand Up @@ -898,7 +898,6 @@ impl<'a> Parser<'a> {
let mut reserved_nums = Vec::new();
let mut reserved_names = Vec::new();


self.tokenizer.next_symbol_expect_eq('{', "enum")?;
while self.tokenizer.lookahead_if_symbol()? != Some('}') {
// emptyStatement
Expand All @@ -911,7 +910,7 @@ impl<'a> Parser<'a> {
reserved_names.extend(field_names);
continue;
}

if let Some(o) = self.next_option_opt()? {
options.push(o);
continue;
Expand All @@ -925,7 +924,7 @@ impl<'a> Parser<'a> {
values,
options,
reserved_nums,
reserved_names
reserved_names,
};
Ok(Some(WithLoc {
loc,
Expand Down Expand Up @@ -1491,12 +1490,7 @@ mod test {

let mess = parse_opt(msg, |p| p.next_message_opt());
assert_eq!(
vec![
4..=4,
15..=15,
17..=20,
30..=30,
],
vec![4..=4, 15..=15, 17..=20, 30..=30,],
mess.t.reserved_nums
);
assert_eq!(
Expand All @@ -1515,12 +1509,7 @@ mod test {

let enum_ = parse_opt(msg, |p| p.next_enum_opt());
assert_eq!(
vec![
4..=4,
15..=15,
17..=20,
30..=30,
],
vec![4..=4, 15..=15, 17..=20, 30..=30,],
enum_.t.reserved_nums
);
assert_eq!(
Expand Down

0 comments on commit b484d8a

Please sign in to comment.