@@ -2,7 +2,7 @@ use arrayvec::ArrayVec;
2
2
use rustc_hash:: FxHashMap as HashMap ;
3
3
use std:: {
4
4
borrow:: { BorrowMut , Cow } ,
5
- cell:: { OnceCell , RefCell } ,
5
+ cell:: RefCell ,
6
6
rc:: Rc ,
7
7
} ;
8
8
@@ -750,29 +750,7 @@ fn stream_chunks_of_source_map_lines_full<'a>(
750
750
#[ derive( Debug ) ]
751
751
struct SourceMapLineData < ' a > {
752
752
pub mappings_data : Vec < i64 > ,
753
- pub chunks : Vec < SourceMapLineChunk < ' a > > ,
754
- }
755
-
756
- #[ derive( Debug ) ]
757
- struct SourceMapLineChunk < ' a > {
758
- content : Cow < ' a , str > ,
759
- cached : OnceCell < WithIndices < Cow < ' a , str > > > ,
760
- }
761
-
762
- impl < ' a > SourceMapLineChunk < ' a > {
763
- pub fn new ( content : Cow < ' a , str > ) -> Self {
764
- Self {
765
- content,
766
- cached : OnceCell :: new ( ) ,
767
- }
768
- }
769
-
770
- pub fn substring ( & self , start_index : usize , end_index : usize ) -> & str {
771
- let cached = self
772
- . cached
773
- . get_or_init ( || WithIndices :: new ( self . content . clone ( ) ) ) ;
774
- cached. substring ( start_index, end_index)
775
- }
753
+ pub chunks : Vec < WithIndices < Cow < ' a , str > > > ,
776
754
}
777
755
778
756
type InnerSourceIndexValueMapping < ' a > =
@@ -1206,7 +1184,7 @@ pub fn stream_chunks_of_combined_source_map<'a>(
1206
1184
. unwrap_or ( -1 ) ,
1207
1185
) ;
1208
1186
// SAFETY: final_source is false
1209
- let chunk = SourceMapLineChunk :: new ( chunk. unwrap ( ) ) ;
1187
+ let chunk = WithIndices :: new ( chunk. unwrap ( ) ) ;
1210
1188
data. chunks . push ( chunk) ;
1211
1189
} ,
1212
1190
& mut |i, source, source_content| {
0 commit comments