File tree Expand file tree Collapse file tree 5 files changed +10
-7
lines changed Expand file tree Collapse file tree 5 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ impl<'a> Nmount<'a> {
391
391
} ) ;
392
392
393
393
let niov = self . iov . len ( ) as c_uint ;
394
- let iovp = self . iov . as_mut_ptr ( ) as * mut libc :: iovec ;
394
+ let iovp = self . iov . as_mut_ptr ( ) ;
395
395
let res = unsafe { libc:: nmount ( iovp, niov, flags. bits ( ) ) } ;
396
396
match Errno :: result ( res) {
397
397
Ok ( _) => Ok ( ( ) ) ,
Original file line number Diff line number Diff line change @@ -770,6 +770,7 @@ enum UnixAddrKind<'a> {
770
770
}
771
771
impl < ' a > UnixAddrKind < ' a > {
772
772
/// Safety: sun & sun_len must be valid
773
+ #[ allow( clippy:: unnecessary_cast) ] // Not unnecessary on all platforms
773
774
unsafe fn get ( sun : & ' a libc:: sockaddr_un , sun_len : u8 ) -> Self {
774
775
assert ! ( sun_len as usize >= offset_of!( libc:: sockaddr_un, sun_path) ) ;
775
776
let path_len =
@@ -806,6 +807,7 @@ impl<'a> UnixAddrKind<'a> {
806
807
807
808
impl UnixAddr {
808
809
/// Create a new sockaddr_un representing a filesystem path.
810
+ #[ allow( clippy:: unnecessary_cast) ] // Not unnecessary on all platforms
809
811
pub fn new < P : ?Sized + NixPath > ( path : & P ) -> Result < UnixAddr > {
810
812
path. with_nix_path ( |cstr| unsafe {
811
813
let mut ret = libc:: sockaddr_un {
@@ -853,6 +855,7 @@ impl UnixAddr {
853
855
/// processes to communicate with processes having a different filesystem view.
854
856
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
855
857
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
858
+ #[ allow( clippy:: unnecessary_cast) ] // Not unnecessary on all platforms
856
859
pub fn new_abstract ( path : & [ u8 ] ) -> Result < UnixAddr > {
857
860
unsafe {
858
861
let mut ret = libc:: sockaddr_un {
Original file line number Diff line number Diff line change @@ -2241,7 +2241,7 @@ pub fn recvfrom<T: SockaddrLike>(
2241
2241
Ok ( (
2242
2242
ret,
2243
2243
T :: from_raw (
2244
- addr. assume_init ( ) . as_ptr ( ) as * const libc :: sockaddr ,
2244
+ addr. assume_init ( ) . as_ptr ( ) ,
2245
2245
Some ( len) ,
2246
2246
) ,
2247
2247
) )
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ mod linux_android {
340
340
341
341
let buf1 = b"abcdef" ;
342
342
let buf2 = b"defghi" ;
343
- let iovecs = vec ! [ IoSlice :: new( & buf1[ 0 ..3 ] ) , IoSlice :: new( & buf2[ 0 ..3 ] ) ] ;
343
+ let iovecs = [ IoSlice :: new ( & buf1[ 0 ..3 ] ) , IoSlice :: new ( & buf2[ 0 ..3 ] ) ] ;
344
344
345
345
let res = vmsplice ( wr, & iovecs[ ..] , SpliceFFlags :: empty ( ) ) . unwrap ( ) ;
346
346
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ fn test_sendfile64_linux() {
63
63
fn test_sendfile_freebsd ( ) {
64
64
// Declare the content
65
65
let header_strings =
66
- vec ! [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
66
+ [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
67
67
let body = "Xabcdef123456" ;
68
68
let body_offset = 1 ;
69
- let trailer_strings = vec ! [ "\n " , "Served by Make Believe\n " ] ;
69
+ let trailer_strings = [ "\n " , "Served by Make Believe\n " ] ;
70
70
71
71
// Write the body to a file
72
72
let mut tmp = tempfile ( ) . unwrap ( ) ;
@@ -114,10 +114,10 @@ fn test_sendfile_freebsd() {
114
114
fn test_sendfile_dragonfly ( ) {
115
115
// Declare the content
116
116
let header_strings =
117
- vec ! [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
117
+ [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
118
118
let body = "Xabcdef123456" ;
119
119
let body_offset = 1 ;
120
- let trailer_strings = vec ! [ "\n " , "Served by Make Believe\n " ] ;
120
+ let trailer_strings = [ "\n " , "Served by Make Believe\n " ] ;
121
121
122
122
// Write the body to a file
123
123
let mut tmp = tempfile ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments