Skip to content

Commit af382dd

Browse files
committed
Fix for windows
1 parent 7f2620b commit af382dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ pub fn compile(
9696
// TODO: do this less hacky; ruff's parser should translate a CRLF line
9797
// break in a multiline string into just an LF in the parsed value
9898
#[cfg(windows)]
99-
let source = &source.replace("\r\n", "\n");
99+
let source = source.replace("\r\n", "\n");
100+
#[cfg(windows)]
101+
let source = source.as_str();
102+
100103
let source_file = SourceFileBuilder::new(source_path, source).finish();
101104
_compile(source_file, mode, opts)
102105
// let index = LineIndex::from_source_text(source);

0 commit comments

Comments
 (0)