@@ -40,7 +40,7 @@ use crate::renderer::{stylesheet::Stylesheet, Margin, Style};
4040/// List of lines to be displayed.
4141pub ( crate ) struct DisplayList < ' a > {
4242 pub body : Vec < DisplayLine < ' a > > ,
43- pub stylesheet : Stylesheet ,
43+ pub stylesheet : & ' a Stylesheet ,
4444 pub anonymized_line_numbers : bool ,
4545 pub margin : Option < Margin > ,
4646}
@@ -108,7 +108,7 @@ impl<'a> DisplayList<'a> {
108108 footer,
109109 slices,
110110 } : snippet:: Snippet < ' a > ,
111- stylesheet : Stylesheet ,
111+ stylesheet : & ' a Stylesheet ,
112112 anonymized_line_numbers : bool ,
113113 margin : Option < Margin > ,
114114 ) -> DisplayList < ' a > {
@@ -1217,7 +1217,7 @@ mod tests {
12171217 fn from_display_lines ( lines : Vec < DisplayLine < ' _ > > ) -> DisplayList < ' _ > {
12181218 DisplayList {
12191219 body : lines,
1220- stylesheet : STYLESHEET ,
1220+ stylesheet : & STYLESHEET ,
12211221 anonymized_line_numbers : false ,
12221222 margin : None ,
12231223 }
@@ -1246,7 +1246,7 @@ mod tests {
12461246 source_aligned: false ,
12471247 continuation: false ,
12481248 } ) ] ) ;
1249- assert_eq ! ( DisplayList :: new( input, STYLESHEET , false , None ) , output) ;
1249+ assert_eq ! ( DisplayList :: new( input, & STYLESHEET , false , None ) , output) ;
12501250 }
12511251
12521252 #[ test]
@@ -1293,7 +1293,7 @@ mod tests {
12931293 line: DisplaySourceLine :: Empty ,
12941294 } ,
12951295 ] ) ;
1296- assert_eq ! ( DisplayList :: new( input, STYLESHEET , false , None ) , output) ;
1296+ assert_eq ! ( DisplayList :: new( input, & STYLESHEET , false , None ) , output) ;
12971297 }
12981298
12991299 #[ test]
@@ -1370,7 +1370,7 @@ mod tests {
13701370 line: DisplaySourceLine :: Empty ,
13711371 } ,
13721372 ] ) ;
1373- assert_eq ! ( DisplayList :: new( input, STYLESHEET , false , None ) , output) ;
1373+ assert_eq ! ( DisplayList :: new( input, & STYLESHEET , false , None ) , output) ;
13741374 }
13751375
13761376 #[ test]
@@ -1440,7 +1440,7 @@ mod tests {
14401440 line: DisplaySourceLine :: Empty ,
14411441 } ,
14421442 ] ) ;
1443- assert_eq ! ( DisplayList :: new( input, STYLESHEET , false , None ) , output) ;
1443+ assert_eq ! ( DisplayList :: new( input, & STYLESHEET , false , None ) , output) ;
14441444 }
14451445
14461446 #[ test]
@@ -1466,7 +1466,7 @@ mod tests {
14661466 source_aligned: true ,
14671467 continuation: false ,
14681468 } ) ] ) ;
1469- assert_eq ! ( DisplayList :: new( input, STYLESHEET , false , None ) , output) ;
1469+ assert_eq ! ( DisplayList :: new( input, & STYLESHEET , false , None ) , output) ;
14701470 }
14711471
14721472 #[ test]
@@ -1489,7 +1489,7 @@ mod tests {
14891489 fold: false ,
14901490 } ] ,
14911491 } ;
1492- let _ = DisplayList :: new ( input, STYLESHEET , false , None ) ;
1492+ let _ = DisplayList :: new ( input, & STYLESHEET , false , None ) ;
14931493 }
14941494
14951495 #[ test]
@@ -1577,7 +1577,7 @@ mod tests {
15771577 } ,
15781578 ] ) ;
15791579 assert_eq ! (
1580- DisplayList :: new( snippets, STYLESHEET , false , None ) ,
1580+ DisplayList :: new( snippets, & STYLESHEET , false , None ) ,
15811581 expected
15821582 ) ;
15831583 }
0 commit comments