clippy --fix

This commit is contained in:
Christien Rioux
2023-09-17 14:14:39 -04:00
parent 6a65b9adee
commit 8a1260ed48
11 changed files with 51 additions and 65 deletions
+3 -5
View File
@@ -242,10 +242,8 @@ pub fn compatible_unspecified_socket_addr(socket_addr: &SocketAddr) -> SocketAdd
pub fn listen_address_to_socket_addrs(listen_address: &str) -> Result<Vec<SocketAddr>, String> {
// If no address is specified, but the port is, use ipv4 and ipv6 unspecified
// If the address is specified, only use the specified port and fail otherwise
let ip_addrs = vec![
IpAddr::V4(Ipv4Addr::UNSPECIFIED),
IpAddr::V6(Ipv6Addr::UNSPECIFIED),
];
let ip_addrs = [IpAddr::V4(Ipv4Addr::UNSPECIFIED),
IpAddr::V6(Ipv6Addr::UNSPECIFIED)];
Ok(if let Some(portstr) = listen_address.strip_prefix(':') {
let port = portstr
@@ -354,7 +352,7 @@ pub unsafe fn unaligned_u8_vec_uninit(n_bytes: usize) -> Vec<u8> {
let ptr = unaligned.as_mut_ptr();
mem::forget(unaligned);
Vec::from_raw_parts(ptr as *mut u8, n_bytes, n_bytes)
Vec::from_raw_parts(ptr, n_bytes, n_bytes)
}
pub fn debug_backtrace() -> String {