File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ impl StyledChar {
1919 }
2020}
2121
22+ impl Default for StyledChar {
23+ fn default ( ) -> Self {
24+ StyledChar :: new ( ' ' , Style :: NoStyle )
25+ }
26+ }
27+
2228impl StyledBuffer {
2329 pub fn new ( ) -> StyledBuffer {
2430 StyledBuffer { text : vec ! [ ] }
@@ -71,7 +77,7 @@ impl StyledBuffer {
7177 } else {
7278 let mut i = self . text [ line] . len ( ) ;
7379 while i < col {
74- self . text [ line] . push ( StyledChar :: new ( ' ' , Style :: NoStyle ) ) ;
80+ self . text [ line] . push ( StyledChar :: default ( ) ) ;
7581 i += 1 ;
7682 }
7783 self . text [ line] . push ( StyledChar :: new ( chr, style) ) ;
@@ -92,7 +98,7 @@ impl StyledBuffer {
9298
9399 // Push the old content over to make room for new content
94100 for _ in 0 ..string_len {
95- self . text [ line] . insert ( 0 , StyledChar :: new ( ' ' , Style :: NoStyle ) ) ;
101+ self . text [ line] . insert ( 0 , StyledChar :: default ( ) ) ;
96102 }
97103
98104 self . puts ( line, 0 , string, style) ;
You can’t perform that action at this time.
0 commit comments