@@ -5,9 +5,11 @@ use crate::backend::c;
55use crate :: backend:: conv:: ret_usize;
66use crate :: backend:: conv:: { borrowed_fd, c_str, ret, ret_c_int, ret_off_t, ret_owned_fd} ;
77use crate :: fd:: { BorrowedFd , OwnedFd } ;
8+ #[ allow( unused_imports) ]
9+ use crate :: ffi;
10+ use crate :: ffi:: CStr ;
811#[ cfg( all( apple, feature = "alloc" ) ) ]
912use crate :: ffi:: CString ;
10- use crate :: ffi:: { self , CStr } ;
1113#[ cfg( not( any( target_os = "espidf" , target_os = "vita" ) ) ) ]
1214use crate :: fs:: Access ;
1315#[ cfg( not( any( target_os = "espidf" , target_os = "redox" ) ) ) ]
@@ -273,13 +275,7 @@ pub(crate) fn statvfs(filename: &CStr) -> io::Result<StatVfs> {
273275#[ cfg( feature = "alloc" ) ]
274276#[ inline]
275277pub ( crate ) fn readlink ( path : & CStr , buf : & mut [ u8 ] ) -> io:: Result < usize > {
276- unsafe {
277- ret_usize ( c:: readlink (
278- c_str ( path) ,
279- buf. as_mut_ptr ( ) . cast :: < ffi:: c_char > ( ) ,
280- buf. len ( ) ,
281- ) as isize )
282- }
278+ unsafe { ret_usize ( c:: readlink ( c_str ( path) , buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) ) as isize ) }
283279}
284280
285281#[ cfg( not( target_os = "redox" ) ) ]
@@ -293,7 +289,7 @@ pub(crate) fn readlinkat(
293289 ret_usize ( c:: readlinkat (
294290 borrowed_fd ( dirfd) ,
295291 c_str ( path) ,
296- buf. as_mut_ptr ( ) . cast :: < ffi :: c_char > ( ) ,
292+ buf. as_mut_ptr ( ) . cast ( ) ,
297293 buf. len ( ) ,
298294 ) as isize )
299295 }
0 commit comments