Skip to content

Commit 7e30152

Browse files
authored
apply clippy advices on test_sendfile_dragonfly/test_recverr tests. (#2534)
remove as_bytes().len() calls when we can call len() on strings. ``` error: needless call to `as_bytes()` ```
1 parent 2939c95 commit 7e30152

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/sys/test_socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ mod linux_errqueue {
29142914
)
29152915
.unwrap();
29162916
// The sent message / destination associated with the error is returned:
2917-
assert_eq!(msg.bytes, MESSAGE_CONTENTS.as_bytes().len());
2917+
assert_eq!(msg.bytes, MESSAGE_CONTENTS.len());
29182918
// recvmsg(2): "The original destination address of the datagram that caused the error is
29192919
// supplied via msg_name;" however, this is not literally true. E.g., an earlier version
29202920
// of this test used 0.0.0.0 (::0) as the destination address, which was mutated into

test/test_sendfile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn test_sendfile_dragonfly() {
143143
+ &trailer_strings.concat();
144144

145145
// Verify the message that was sent
146-
assert_eq!(bytes_written as usize, expected_string.as_bytes().len());
146+
assert_eq!(bytes_written as usize, expected_string.len());
147147

148148
let mut read_string = String::new();
149149
let bytes_read = rd.read_to_string(&mut read_string).unwrap();

0 commit comments

Comments
 (0)