Skip to content

Commit 2e8792b

Browse files
committed
win panic fix
1 parent 322e80a commit 2e8792b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
24+
os: ["windows-latest"]
2525
rust: ["stable", "1.83"]
2626
flags: ["", "--all-features"]
2727
exclude:

crates/compilers/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,10 @@ fn replace_source_content<'a>(
914914
let start = (range.start as isize + offset) as usize;
915915
let end = (range.end as isize + offset) as usize;
916916

917+
let new_value = String::from_utf8(new_value.as_bytes().to_vec()).unwrap();
917918
content.splice(start..end, new_value.bytes());
918-
offset += new_value.len() as isize - (end - start) as isize;
919+
920+
offset += new_value.bytes().len() as isize - (end - start) as isize;
919921
}
920922

921923
String::from_utf8(content).unwrap()

0 commit comments

Comments
 (0)