@@ -84,9 +84,9 @@ fn write(
84
84
if data[ 0 ] >> 6 != 0b10 {
85
85
incomplete_utf8. len = 0 ;
86
86
// not a continuation byte - reject
87
- return Err ( io:: Error :: new (
87
+ return Err ( io:: Error :: new_const (
88
88
io:: ErrorKind :: InvalidData ,
89
- "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" ,
89
+ & "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" ,
90
90
) ) ;
91
91
}
92
92
incomplete_utf8. bytes [ incomplete_utf8. len as usize ] = data[ 0 ] ;
@@ -106,9 +106,9 @@ fn write(
106
106
return Ok ( 1 ) ;
107
107
}
108
108
Err ( _) => {
109
- return Err ( io:: Error :: new (
109
+ return Err ( io:: Error :: new_const (
110
110
io:: ErrorKind :: InvalidData ,
111
- "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" ,
111
+ & "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" ,
112
112
) ) ;
113
113
}
114
114
}
@@ -134,9 +134,9 @@ fn write(
134
134
incomplete_utf8. len = 1 ;
135
135
return Ok ( 1 ) ;
136
136
} else {
137
- return Err ( io:: Error :: new (
137
+ return Err ( io:: Error :: new_const (
138
138
io:: ErrorKind :: InvalidData ,
139
- "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" ,
139
+ & "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" ,
140
140
) ) ;
141
141
}
142
142
}
0 commit comments