File tree Expand file tree Collapse file tree 4 files changed +6
-14
lines changed Expand file tree Collapse file tree 4 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,6 @@ impl Surface {
152
152
153
153
#[ cfg( test) ]
154
154
mod tests {
155
- use std:: io:: ErrorKind ;
156
-
157
155
use super :: * ;
158
156
use crate :: enums:: Format ;
159
157
@@ -162,7 +160,7 @@ mod tests {
162
160
// A reader that always returns an error
163
161
impl Read for IoErrorReader {
164
162
fn read ( & mut self , _: & mut [ u8 ] ) -> Result < usize , io:: Error > {
165
- Err ( io:: Error :: new ( ErrorKind :: Other , "yikes!" ) )
163
+ Err ( io:: Error :: other ( "yikes!" ) )
166
164
}
167
165
}
168
166
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ impl From<IOErrorEnum> for io::ErrorKind {
31
31
pub ( crate ) fn to_std_io_result < T > ( result : Result < T , glib:: Error > ) -> io:: Result < T > {
32
32
result. map_err ( |g_error| match g_error. kind :: < IOErrorEnum > ( ) {
33
33
Some ( io_error_enum) => io:: Error :: new ( io_error_enum. into ( ) , g_error) ,
34
- None => io:: Error :: new ( io :: ErrorKind :: Other , g_error) ,
34
+ None => io:: Error :: other ( g_error) ,
35
35
} )
36
36
}
37
37
Original file line number Diff line number Diff line change @@ -234,14 +234,11 @@ impl AnyReader {
234
234
Ok ( res) => res,
235
235
Err ( panic) => {
236
236
self . reader = AnyOrPanic :: Panic ( panic) ;
237
- Err ( std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , "Panicked" ) )
237
+ Err ( std:: io:: Error :: other ( "Panicked" ) )
238
238
}
239
239
}
240
240
}
241
- AnyOrPanic :: Panic ( _) => Err ( std:: io:: Error :: new (
242
- std:: io:: ErrorKind :: Other ,
243
- "Panicked before" ,
244
- ) ) ,
241
+ AnyOrPanic :: Panic ( _) => Err ( std:: io:: Error :: other ( "Panicked before" ) ) ,
245
242
}
246
243
}
247
244
Original file line number Diff line number Diff line change @@ -263,14 +263,11 @@ impl AnyWriter {
263
263
Ok ( res) => res,
264
264
Err ( panic) => {
265
265
self . writer = AnyOrPanic :: Panic ( panic) ;
266
- Err ( std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , "Panicked" ) )
266
+ Err ( std:: io:: Error :: other ( "Panicked" ) )
267
267
}
268
268
}
269
269
}
270
- AnyOrPanic :: Panic ( _) => Err ( std:: io:: Error :: new (
271
- std:: io:: ErrorKind :: Other ,
272
- "Panicked before" ,
273
- ) ) ,
270
+ AnyOrPanic :: Panic ( _) => Err ( std:: io:: Error :: other ( "Panicked before" ) ) ,
274
271
}
275
272
}
276
273
You can’t perform that action at this time.
0 commit comments