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 @@ -484,6 +484,7 @@ enum UnixAddrKind<'a> {
484
484
}
485
485
impl < ' a > UnixAddrKind < ' a > {
486
486
/// Safety: sun & sun_len must be valid
487
+ #[ allow( clippy:: unnecessary_cast) ] // Not unnecessary on all platforms
487
488
unsafe fn get ( sun : & ' a libc:: sockaddr_un , sun_len : u8 ) -> Self {
488
489
assert ! ( sun_len as usize >= offset_of!( libc:: sockaddr_un, sun_path) ) ;
489
490
let path_len =
@@ -520,6 +521,7 @@ impl<'a> UnixAddrKind<'a> {
520
521
521
522
impl UnixAddr {
522
523
/// Create a new sockaddr_un representing a filesystem path.
524
+ #[ allow( clippy:: unnecessary_cast) ] // Not unnecessary on all platforms
523
525
pub fn new < P : ?Sized + NixPath > ( path : & P ) -> Result < UnixAddr > {
524
526
path. with_nix_path ( |cstr| unsafe {
525
527
let mut ret = libc:: sockaddr_un {
@@ -567,6 +569,7 @@ impl UnixAddr {
567
569
/// processes to communicate with processes having a different filesystem view.
568
570
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
569
571
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
572
+ #[ allow( clippy:: unnecessary_cast) ] // Not unnecessary on all platforms
570
573
pub fn new_abstract ( path : & [ u8 ] ) -> Result < UnixAddr > {
571
574
unsafe {
572
575
let mut ret = libc:: sockaddr_un {
Original file line number Diff line number Diff line change @@ -2234,7 +2234,7 @@ pub fn recvfrom<T: SockaddrLike>(
2234
2234
Ok ( (
2235
2235
ret,
2236
2236
T :: from_raw (
2237
- addr. assume_init ( ) . as_ptr ( ) as * const sockaddr ,
2237
+ addr. assume_init ( ) . as_ptr ( ) ,
2238
2238
Some ( len) ,
2239
2239
) ,
2240
2240
) )
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 @@ -72,10 +72,10 @@ fn test_sendfile64_linux() {
72
72
fn test_sendfile_freebsd ( ) {
73
73
// Declare the content
74
74
let header_strings =
75
- vec ! [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
75
+ [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
76
76
let body = "Xabcdef123456" ;
77
77
let body_offset = 1 ;
78
- let trailer_strings = vec ! [ "\n " , "Served by Make Believe\n " ] ;
78
+ let trailer_strings = [ "\n " , "Served by Make Believe\n " ] ;
79
79
80
80
// Write the body to a file
81
81
let mut tmp = tempfile ( ) . unwrap ( ) ;
@@ -123,10 +123,10 @@ fn test_sendfile_freebsd() {
123
123
fn test_sendfile_dragonfly ( ) {
124
124
// Declare the content
125
125
let header_strings =
126
- vec ! [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
126
+ [ "HTTP/1.1 200 OK\n " , "Content-Type: text/plain\n " , "\n " ] ;
127
127
let body = "Xabcdef123456" ;
128
128
let body_offset = 1 ;
129
- let trailer_strings = vec ! [ "\n " , "Served by Make Believe\n " ] ;
129
+ let trailer_strings = [ "\n " , "Served by Make Believe\n " ] ;
130
130
131
131
// Write the body to a file
132
132
let mut tmp = tempfile ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments