Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mhasel committed Oct 7, 2024
1 parent 4e257cb commit d750c49
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/expression_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ impl<'idx> ExpressionPath<'idx> {
array
}
ExpressionPathElement::ArrayAccess(idx) => {
let Some(first) = idx.first() else {
unreachable!("Caught at the parsing stage")
};
let Some(first) = idx.first() else { unreachable!("Caught at the parsing stage") };

let access =
idx.iter().skip(1).fold(format!("{first}"), |acc, idx| format!("{acc},{idx}"));
Expand Down Expand Up @@ -120,7 +118,7 @@ impl<'a> TryFrom<&'a ConfigVariable> for ExpressionPath<'a> {
}

// Transforms a `ConfigVariable`'s 'AstNode' into a collection of corresponding `ExpressionPathElement`s.
// This function will traverse the AST top-to-bottom, collecting segments along the way, which means the order of the collection
// This function will traverse the AST top-to-bottom, collecting segments along the way, which means the order of the collection
// needs to be reversed by the caller to match the written expression.
fn get_expression_path_segments(node: &AstNode) -> Result<Vec<ExpressionPathElement>, Vec<Diagnostic>> {
let mut paths = vec![];
Expand Down

0 comments on commit d750c49

Please sign in to comment.