support raw strings in match patterns (#14573)

Fixes #14554

# User-Facing Changes

Raw strings are now supported in match patterns:

```diff
match "foo" { r#'foo'# => true, _ => false }
-false
+true
```
This commit is contained in:
Solomon
2024-12-13 05:55:57 -07:00
committed by GitHub
parent 0b96962157
commit 49f377688a
2 changed files with 10 additions and 1 deletions

View File

@ -128,7 +128,7 @@ impl Matcher for Pattern {
false
}
}
Expr::String(x) => {
Expr::String(x) | Expr::RawString(x) => {
if let Value::String { val, .. } = &value {
x == val
} else {