@@ -2,7 +2,7 @@ use arrayvec::ArrayVec;
22use rustc_hash:: FxHashMap as HashMap ;
33use std:: {
44 borrow:: { BorrowMut , Cow } ,
5- cell:: { OnceCell , RefCell } ,
5+ cell:: RefCell ,
66 rc:: Rc ,
77} ;
88
@@ -750,29 +750,7 @@ fn stream_chunks_of_source_map_lines_full<'a>(
750750#[ derive( Debug ) ]
751751struct SourceMapLineData < ' a > {
752752 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 > > > ,
776754}
777755
778756type InnerSourceIndexValueMapping < ' a > =
@@ -1206,7 +1184,7 @@ pub fn stream_chunks_of_combined_source_map<'a>(
12061184 . unwrap_or ( -1 ) ,
12071185 ) ;
12081186 // SAFETY: final_source is false
1209- let chunk = SourceMapLineChunk :: new ( chunk. unwrap ( ) ) ;
1187+ let chunk = WithIndices :: new ( chunk. unwrap ( ) ) ;
12101188 data. chunks . push ( chunk) ;
12111189 } ,
12121190 & mut |i, source, source_content| {
0 commit comments