Skip to content

Commit a444a38

Browse files
committed
Consistently use sm for name of SourceMap variables
This might have used to be called CodeMap.
1 parent c1a71a9 commit a444a38

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/fallback.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ fn get_cursor(src: &str) -> Cursor {
151151

152152
// Create a dummy file & add it to the source map
153153
#[cfg(not(fuzzing))]
154-
SOURCE_MAP.with(|cm| {
155-
let mut cm = cm.borrow_mut();
156-
let span = cm.add_file(src);
154+
SOURCE_MAP.with(|sm| {
155+
let mut sm = sm.borrow_mut();
156+
let span = sm.add_file(src);
157157
Cursor {
158158
rest: src,
159159
off: span.lo,
@@ -540,9 +540,9 @@ impl Span {
540540
};
541541

542542
#[cfg(not(fuzzing))]
543-
SOURCE_MAP.with(|cm| {
544-
let cm = cm.borrow();
545-
let path = cm.filepath(*self);
543+
SOURCE_MAP.with(|sm| {
544+
let sm = sm.borrow();
545+
let path = sm.filepath(*self);
546546
SourceFile { path }
547547
})
548548
}
@@ -553,9 +553,9 @@ impl Span {
553553
return LineColumn { line: 0, column: 0 };
554554

555555
#[cfg(not(fuzzing))]
556-
SOURCE_MAP.with(|cm| {
557-
let cm = cm.borrow();
558-
let fi = cm.fileinfo(*self);
556+
SOURCE_MAP.with(|sm| {
557+
let sm = sm.borrow();
558+
let fi = sm.fileinfo(*self);
559559
fi.offset_line_column(self.lo as usize)
560560
})
561561
}
@@ -566,9 +566,9 @@ impl Span {
566566
return LineColumn { line: 0, column: 0 };
567567

568568
#[cfg(not(fuzzing))]
569-
SOURCE_MAP.with(|cm| {
570-
let cm = cm.borrow();
571-
let fi = cm.fileinfo(*self);
569+
SOURCE_MAP.with(|sm| {
570+
let sm = sm.borrow();
571+
let fi = sm.fileinfo(*self);
572572
fi.offset_line_column(self.hi as usize)
573573
})
574574
}
@@ -587,10 +587,10 @@ impl Span {
587587
};
588588

589589
#[cfg(not(fuzzing))]
590-
SOURCE_MAP.with(|cm| {
591-
let cm = cm.borrow();
590+
SOURCE_MAP.with(|sm| {
591+
let sm = sm.borrow();
592592
// If `other` is not within the same FileInfo as us, return None.
593-
if !cm.fileinfo(*self).span_within(other) {
593+
if !sm.fileinfo(*self).span_within(other) {
594594
return None;
595595
}
596596
Some(Span {
@@ -615,7 +615,7 @@ impl Span {
615615
if self.is_call_site() {
616616
None
617617
} else {
618-
Some(SOURCE_MAP.with(|cm| cm.borrow_mut().fileinfo_mut(*self).source_text(*self)))
618+
Some(SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).source_text(*self)))
619619
}
620620
}
621621
}

0 commit comments

Comments
 (0)