Skip to content

Commit 6b3e887

Browse files
committed
clean
1 parent 67ac483 commit 6b3e887

File tree

1 file changed

+3
-8
lines changed
  • crates/compilers/src/preprocessor

1 file changed

+3
-8
lines changed

crates/compilers/src/preprocessor/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ use itertools::Itertools;
1717
use md5::Digest;
1818
use solar_parse::{
1919
ast::{FunctionKind, ItemKind, Span, Visibility},
20-
interface::{
21-
diagnostics::EmittedDiagnostics, source_map::FileName, BytePos, Session, SourceMap,
22-
},
20+
interface::{diagnostics::EmittedDiagnostics, source_map::FileName, Session, SourceMap},
2321
Parser,
2422
};
2523
use solar_sema::{thread_local::ThreadLocal, ParsingContext};
@@ -44,12 +42,9 @@ pub struct SourceMapLocation {
4442
impl SourceMapLocation {
4543
/// Creates source map location from an item location within a source file.
4644
fn from_span(source_map: &SourceMap, span: Span) -> Self {
47-
let range = span.to_range();
48-
let start_pos = BytePos::from_usize(range.start);
49-
let end_pos = BytePos::from_usize(range.end);
5045
Self {
51-
start: source_map.lookup_byte_offset(start_pos).pos.to_usize(),
52-
end: source_map.lookup_byte_offset(end_pos).pos.to_usize(),
46+
start: source_map.lookup_byte_offset(span.lo()).pos.to_usize(),
47+
end: source_map.lookup_byte_offset(span.hi()).pos.to_usize(),
5348
}
5449
}
5550
}

0 commit comments

Comments
 (0)