Skip to content

Commit

Permalink
CI failed when running locally on this.
Browse files Browse the repository at this point in the history
  • Loading branch information
vortexofdoom committed Feb 2, 2024
1 parent c006a09 commit f56cd46
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions godot-macros/src/util/list_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,14 @@ impl ListParser {
///
/// Returns `Ok(None)` if there are no more elements left.
pub fn next_ident(&mut self) -> ParseResult<Option<Ident>> {
let Some(kv) = self.pop_next() else {
return Ok(None);
};

Ok(Some(kv.ident()?))
self.pop_next().map(|kv| kv.ident()).transpose()
}

/// Check if the next element of the list is an identifier.
///
/// Returns `None` if there are no more elements left, `Some(true)` if the next element is identifier and `Some(false)` if it is not.
pub fn is_next_ident(&mut self) -> Option<bool> {
let Some(kv) = self.peek() else {
return None;
};

let res = kv.as_ident();

Some(res.is_ok())
Some(self.peek()?.as_ident().is_ok())
}

/// Take the next element of the list, if it is an identifier.
Expand Down

0 comments on commit f56cd46

Please sign in to comment.