Skip to content

Commit

Permalink
fix test_sendfile_dragonfly/test_recverr tests.
Browse files Browse the repository at this point in the history
remove as_bytes().len() calls when we can call len() on strings.
```
error: needless call to `as_bytes()`
```
  • Loading branch information
devnexen committed Nov 11, 2024
1 parent 2939c95 commit acd1527
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/sys/test_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2914,7 +2914,7 @@ mod linux_errqueue {
)
.unwrap();
// The sent message / destination associated with the error is returned:
assert_eq!(msg.bytes, MESSAGE_CONTENTS.as_bytes().len());
assert_eq!(msg.bytes, MESSAGE_CONTENTS.len());
// recvmsg(2): "The original destination address of the datagram that caused the error is
// supplied via msg_name;" however, this is not literally true. E.g., an earlier version
// of this test used 0.0.0.0 (::0) as the destination address, which was mutated into
Expand Down
2 changes: 1 addition & 1 deletion test/test_sendfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fn test_sendfile_dragonfly() {
+ &trailer_strings.concat();

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

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

0 comments on commit acd1527

Please sign in to comment.