Skip to content

Commit 534a28c

Browse files
committed
Clippy cleanup: dangerous_implicit_autorefs
1 parent 989291d commit 534a28c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sys/socket/addr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,7 @@ mod tests {
24282428
let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap();
24292429

24302430
let sun_path1 =
2431-
unsafe { &(*addr.as_ptr()).sun_path[..addr.path_len()] };
2431+
unsafe { &(&(*addr.as_ptr()).sun_path)[..addr.path_len()] };
24322432
let sun_path2 = [
24332433
0, 110, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0,
24342434
116, 101, 115, 116,

test/sys/test_socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub fn test_path_to_sock_addr() {
200200

201201
let expect: &[c_char] =
202202
unsafe { slice::from_raw_parts(path.as_ptr().cast(), path.len()) };
203-
assert_eq!(unsafe { &(*addr.as_ptr()).sun_path[..8] }, expect);
203+
assert_eq!(unsafe { &(&(*addr.as_ptr()).sun_path)[..8] }, expect);
204204

205205
assert_eq!(addr.path(), Some(actual));
206206
}

0 commit comments

Comments
 (0)