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 {
19
19
}
20
20
}
21
21
22
+ impl Default for StyledChar {
23
+ fn default ( ) -> Self {
24
+ StyledChar :: new ( ' ' , Style :: NoStyle )
25
+ }
26
+ }
27
+
22
28
impl StyledBuffer {
23
29
pub fn new ( ) -> StyledBuffer {
24
30
StyledBuffer { text : vec ! [ ] }
@@ -71,7 +77,7 @@ impl StyledBuffer {
71
77
} else {
72
78
let mut i = self . text [ line] . len ( ) ;
73
79
while i < col {
74
- self . text [ line] . push ( StyledChar :: new ( ' ' , Style :: NoStyle ) ) ;
80
+ self . text [ line] . push ( StyledChar :: default ( ) ) ;
75
81
i += 1 ;
76
82
}
77
83
self . text [ line] . push ( StyledChar :: new ( chr, style) ) ;
@@ -92,7 +98,7 @@ impl StyledBuffer {
92
98
93
99
// Push the old content over to make room for new content
94
100
for _ in 0 ..string_len {
95
- self . text [ line] . insert ( 0 , StyledChar :: new ( ' ' , Style :: NoStyle ) ) ;
101
+ self . text [ line] . insert ( 0 , StyledChar :: default ( ) ) ;
96
102
}
97
103
98
104
self . puts ( line, 0 , string, style) ;
You can’t perform that action at this time.
0 commit comments