Skip to content

Commit

Permalink
Merge branch 'main' into fix-handling-binary-expr
Browse files Browse the repository at this point in the history
  • Loading branch information
waynexia authored Jul 10, 2024
2 parents 3d7b51c + 6e46e66 commit 0e8c107
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/parser/promql.y
Original file line number Diff line number Diff line change
Expand Up @@ -587,20 +587,14 @@ fn update_optional_matching(
modifier: Option<BinModifier>,
matching: Option<LabelModifier>,
) -> Option<BinModifier> {
let modifier = match modifier {
Some(modifier) => modifier,
None => Default::default(),
};
let modifier = modifier.unwrap_or_default();
Some(modifier.with_matching(matching))
}

fn update_optional_card(
modifier: Option<BinModifier>,
card: VectorMatchCardinality,
) -> Option<BinModifier> {
let modifier = match modifier {
Some(modifier) => modifier,
None => Default::default(),
};
let modifier = modifier.unwrap_or_default();
Some(modifier.with_card(card))
}

0 comments on commit 0e8c107

Please sign in to comment.