Skip to content

Commit 8591697

Browse files
bcpeinhardtlpil
authored andcommitted
fix the bug
1 parent f83183d commit 8591697

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

compiler-core/src/erlang/pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn pattern_segment<'a>(
259259
let guards = RefCell::new(guards);
260260

261261
let create_document = |env: &mut Env<'a>| match value {
262-
Pattern::String { value, .. } => value.to_doc().surround("\"", "\""),
262+
Pattern::String { value, .. } => string_inner(value).surround("\"", "\""),
263263
Pattern::Discard { .. }
264264
| Pattern::Variable { .. }
265265
| Pattern::Int { .. }
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
source: compiler-core/src/erlang/tests/bit_arrays.rs
3-
assertion_line: 320
43
expression: "\npub fn main() -> Nil {\n let foo = <<\"\\u{feff}foo\":utf8>>\n let _bits = case foo {\n <<\"\\u{feff}\":utf8, rest: bits>> -> rest\n _ -> foo\n }\n Nil\n}\n"
5-
snapshot_kind: text
64
---
75
----- SOURCE CODE
86

@@ -27,7 +25,7 @@ pub fn main() -> Nil {
2725
main() ->
2826
Foo = <<"\x{feff}foo"/utf8>>,
2927
_ = case Foo of
30-
<<"\u{feff}"/utf8, Rest/bitstring>> ->
28+
<<"\x{feff}"/utf8, Rest/bitstring>> ->
3129
Rest;
3230

3331
_ ->

0 commit comments

Comments
 (0)