@@ -209,7 +209,7 @@ pub struct SourceMap {
209209 #[ serde( rename = "debugId" , skip_serializing_if = "Option::is_none" ) ]
210210 debug_id : Option < Arc < str > > ,
211211 #[ serde( rename = "ignoreList" , skip_serializing_if = "Option::is_none" ) ]
212- ignore_list : Option < Vec < u32 > > ,
212+ ignore_list : Option < Arc < Vec < u32 > > > ,
213213}
214214
215215impl std:: fmt:: Debug for SourceMap {
@@ -280,12 +280,12 @@ impl SourceMap {
280280
281281 /// Get the ignoreList field in [SourceMap].
282282 pub fn ignore_list ( & self ) -> Option < & [ u32 ] > {
283- self . ignore_list . as_deref ( )
283+ self . ignore_list . as_deref ( ) . map ( |v| & * * v )
284284 }
285285
286286 /// Set the ignoreList field in [SourceMap].
287287 pub fn set_ignore_list < T : Into < Vec < u32 > > > ( & mut self , ignore_list : Option < T > ) {
288- self . ignore_list = ignore_list. map ( Into :: into) ;
288+ self . ignore_list = ignore_list. map ( |v| Arc :: new ( v . into ( ) ) ) ;
289289 }
290290
291291 /// Get the decoded mappings in [SourceMap].
@@ -460,6 +460,7 @@ impl TryFrom<RawSourceMap> for SourceMap {
460460 . into ( ) ;
461461 let source_root = raw. source_root . map ( Into :: into) ;
462462 let debug_id = raw. debug_id . map ( Into :: into) ;
463+ let ignore_list = raw. ignore_list . map ( Into :: into) ;
463464
464465 Ok ( Self {
465466 version : 3 ,
@@ -470,7 +471,7 @@ impl TryFrom<RawSourceMap> for SourceMap {
470471 names,
471472 source_root,
472473 debug_id,
473- ignore_list : raw . ignore_list ,
474+ ignore_list,
474475 } )
475476 }
476477}
0 commit comments