We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 16362c7 commit f237e9eCopy full SHA for f237e9e
src/libsyntax/codemap.rs
@@ -690,14 +690,16 @@ impl CodeMap {
690
return 1;
691
}
692
693
+ let src = local_begin.fm.external_src.borrow();
694
+
695
// We need to extend the snippet to the end of the src rather than to end_index so when
696
// searching forwards for boundaries we've got somewhere to search.
697
let snippet = if let Some(ref src) = local_begin.fm.src {
698
let len = src.len();
- (&src[start_index..len]).to_string()
- } else if let Some(src) = local_begin.fm.external_src.borrow().get_source() {
699
+ (&src[start_index..len])
700
+ } else if let Some(src) = src.get_source() {
701
702
703
} else {
704
705
};
0 commit comments