File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,9 @@ fn read_u32<T: Read>(reader: &mut T) -> Result<u32> {
18
18
fn check_magic_number < T : Read > ( reader : & mut T , expected : u32 ) -> Result < ( ) > {
19
19
let magic_number = read_u32 ( reader) ?;
20
20
if magic_number != expected {
21
- return Err ( io:: Error :: new (
22
- io:: ErrorKind :: Other ,
23
- format ! ( "incorrect magic number {magic_number} != {expected}" ) ,
24
- ) ) ;
21
+ return Err ( io:: Error :: other ( format ! (
22
+ "incorrect magic number {magic_number} != {expected}"
23
+ ) ) ) ;
25
24
}
26
25
Ok ( ( ) )
27
26
}
Original file line number Diff line number Diff line change @@ -48,10 +48,9 @@ pub(super) fn path_to_cstring<T: AsRef<std::path::Path>>(
48
48
let path = path. as_ref ( ) ;
49
49
match path. to_str ( ) {
50
50
Some ( path) => Ok ( std:: ffi:: CString :: new ( path) ?) ,
51
- None => Err ( TchError :: Io ( io:: Error :: new (
52
- io:: ErrorKind :: Other ,
53
- format ! ( "path {path:?} cannot be converted to UTF-8" ) ,
54
- ) ) ) ,
51
+ None => Err ( TchError :: Io ( io:: Error :: other ( format ! (
52
+ "path {path:?} cannot be converted to UTF-8"
53
+ ) ) ) ) ,
55
54
}
56
55
}
57
56
You can’t perform that action at this time.
0 commit comments