Skip to content

Commit

Permalink
Merge branch 'main' into test-stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevyor committed Apr 2, 2024
2 parents fb565a3 + fec6c16 commit 46aee8f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: code quality
on:
push:
branches: [main]
pull_request_target:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ (github.ref == 'refs/heads/main' && github.sha) || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: main
on:
push:
branches: [main]
pull_request_target:
pull_request:
branches: [main]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pr-lint

on:
pull_request_target:
pull_request:
types:
- opened
- edited
Expand Down
4 changes: 4 additions & 0 deletions crates/core/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ impl Constant {
Constant::Undefined => false,
}
}

pub(crate) fn is_undefined(&self) -> bool {
matches!(self, Self::Undefined)
}
}

impl Display for Constant {
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/pattern/resolved_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ impl<'a> ResolvedPattern<'a> {
ResolvedPattern::Binding(b) => b
.last()
.and_then(Binding::as_constant)
.map_or(false, |c| c == &Constant::Undefined),
.map_or(false, Constant::is_undefined),
ResolvedPattern::Constant(Constant::Undefined) => true,
ResolvedPattern::Constant(_)
| ResolvedPattern::Snippets(_)
Expand Down

0 comments on commit 46aee8f

Please sign in to comment.