Skip to content

Commit 970f734

Browse files
committed
manually inline the parse_value function
1 parent 60df6f9 commit 970f734

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cfgrammar/src/lib/header.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,7 @@ impl<'input> GrmtoolsSectionParser<'input> {
372372
},
373373
}
374374
}
375-
fn parse_value(&'_ self, i: usize) -> Result<(Value<Span>, usize), HeaderError<Span>> {
376-
let (setting, pos) = self.parse_setting(i)?;
377-
Ok((Value::Setting(setting), pos))
378-
}
375+
379376
pub fn parse_key_value(
380377
&'_ self,
381378
mut i: usize,
@@ -393,8 +390,8 @@ impl<'input> GrmtoolsSectionParser<'input> {
393390
let key_span = Span::new(i, j);
394391
i = self.parse_ws(j);
395392
if let Some(j) = self.lookahead_is(":", i) {
396-
let (val, j) = self.parse_value(j)?;
397-
Ok((key_name, key_span, val, j))
393+
let (val, j) = self.parse_setting(j)?;
394+
Ok((key_name, key_span, Value::Setting(val), j))
398395
} else {
399396
Ok((key_name, key_span, Value::Flag(true, key_span), i))
400397
}

0 commit comments

Comments
 (0)