@@ -84,9 +84,9 @@ fn write(
8484 if data[ 0 ] >> 6 != 0b10 {
8585 incomplete_utf8. len = 0 ;
8686 // not a continuation byte - reject
87- return Err ( io:: Error :: new (
87+ return Err ( io:: Error :: new_const (
8888 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" ,
9090 ) ) ;
9191 }
9292 incomplete_utf8. bytes [ incomplete_utf8. len as usize ] = data[ 0 ] ;
@@ -106,9 +106,9 @@ fn write(
106106 return Ok ( 1 ) ;
107107 }
108108 Err ( _) => {
109- return Err ( io:: Error :: new (
109+ return Err ( io:: Error :: new_const (
110110 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" ,
112112 ) ) ;
113113 }
114114 }
@@ -134,9 +134,9 @@ fn write(
134134 incomplete_utf8. len = 1 ;
135135 return Ok ( 1 ) ;
136136 } else {
137- return Err ( io:: Error :: new (
137+ return Err ( io:: Error :: new_const (
138138 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" ,
140140 ) ) ;
141141 }
142142 }
0 commit comments