diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 8ba1b4a..d5810b1 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -20,7 +20,9 @@ fn main() -> io::Result<()> { if tldr_zip.is_none() { println!("Warning: No tldr archive found, so the documentation will not include examples."); - println!("To include examples in the documentation, download the tldr archive and put it in the docs/ folder."); + println!( + "To include examples in the documentation, download the tldr archive and put it in the docs/ folder." + ); println!(); println!(" curl https://tldr.sh/assets/tldr.zip -o docs/tldr.zip"); println!(); diff --git a/src/uu/hostname/src/hostname.rs b/src/uu/hostname/src/hostname.rs index 71ec76a..caf5f72 100644 --- a/src/uu/hostname/src/hostname.rs +++ b/src/uu/hostname/src/hostname.rs @@ -12,7 +12,7 @@ mod utils; use std::ffi::OsString; use std::path::PathBuf; -use clap::{crate_version, value_parser, Arg, ArgAction, ArgGroup, Command}; +use clap::{Arg, ArgAction, ArgGroup, Command, crate_version, value_parser}; use uucore::{error::UResult, format_usage, help_about, help_usage}; const ABOUT: &str = help_about!("hostname.md"); diff --git a/src/uu/hostname/src/net/unix.rs b/src/uu/hostname/src/net/unix.rs index 272a4b3..4b255b5 100644 --- a/src/uu/hostname/src/net/unix.rs +++ b/src/uu/hostname/src/net/unix.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use std::ffi::{c_int, CStr, CString}; +use std::ffi::{CStr, CString, c_int}; use std::ptr; use std::ptr::NonNull; diff --git a/src/uu/hostname/src/net/windows.rs b/src/uu/hostname/src/net/windows.rs index 0fe4809..0155754 100644 --- a/src/uu/hostname/src/net/windows.rs +++ b/src/uu/hostname/src/net/windows.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use std::ffi::{c_int, OsStr, OsString}; +use std::ffi::{OsStr, OsString, c_int}; use std::os::windows::ffi::{OsStrExt, OsStringExt}; use std::ptr::NonNull; use std::{mem, ptr}; @@ -14,12 +14,12 @@ use windows_sys::Win32::Foundation::{ ERROR_MORE_DATA, ERROR_NO_DATA, ERROR_SUCCESS, }; use windows_sys::Win32::NetworkManagement::IpHelper::{ - GetAdaptersAddresses, GAA_FLAG_SKIP_DNS_SERVER, GAA_FLAG_SKIP_FRIENDLY_NAME, + GAA_FLAG_SKIP_DNS_SERVER, GAA_FLAG_SKIP_FRIENDLY_NAME, GetAdaptersAddresses, IP_ADAPTER_ADDRESSES_LH, IP_ADAPTER_UNICAST_ADDRESS_LH, }; use windows_sys::Win32::Networking::WinSock::{ - socklen_t, FreeAddrInfoW, GetAddrInfoW, GetNameInfoW, WSACleanup, WSAGetLastError, WSAStartup, - ADDRINFOW, AF_UNSPEC, IN6_ADDR, SOCKADDR, WSADATA, WSAENAMETOOLONG, WSAENOBUFS, + ADDRINFOW, AF_UNSPEC, FreeAddrInfoW, GetAddrInfoW, GetNameInfoW, IN6_ADDR, SOCKADDR, + WSACleanup, WSADATA, WSAENAMETOOLONG, WSAENOBUFS, WSAGetLastError, WSAStartup, socklen_t, }; use windows_sys::Win32::System::SystemInformation::{ ComputerNamePhysicalDnsDomain, ComputerNamePhysicalDnsFullyQualified, diff --git a/src/uu/hostname/src/print/unix.rs b/src/uu/hostname/src/print/unix.rs index 39de849..4eb7f34 100644 --- a/src/uu/hostname/src/print/unix.rs +++ b/src/uu/hostname/src/print/unix.rs @@ -3,19 +3,19 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use std::ffi::{c_int, c_uint, CStr}; +use std::ffi::{CStr, c_int, c_uint}; use std::ptr::NonNull; use libc::{ - sockaddr, sockaddr_in, sockaddr_in6, socklen_t, AF_UNSPEC, AI_CANONNAME, IFF_LOOPBACK, IFF_UP, - NI_NAMEREQD, NI_NUMERICHOST, SOCK_DGRAM, + AF_UNSPEC, AI_CANONNAME, IFF_LOOPBACK, IFF_UP, NI_NAMEREQD, NI_NUMERICHOST, SOCK_DGRAM, + sockaddr, sockaddr_in, sockaddr_in6, socklen_t, }; use uucore::error::UResult; use crate::errors::{GetNameOrAddrInfoError, HostNameError}; use crate::net::{ - domain_name, get_name_info, host_name, in6_is_addr_linklocal, in6_is_addr_mc_linklocal, - short_host_name, AddressInfo, InterfaceAddresses, + AddressInfo, InterfaceAddresses, domain_name, get_name_info, host_name, in6_is_addr_linklocal, + in6_is_addr_mc_linklocal, short_host_name, }; use crate::print::{ AliasHostName, AllFqdnHostName, AllIpAddressesHostName, DefaultHostName, DomainHostName, diff --git a/src/uu/hostname/src/print/windows.rs b/src/uu/hostname/src/print/windows.rs index abacca5..d83222a 100644 --- a/src/uu/hostname/src/print/windows.rs +++ b/src/uu/hostname/src/print/windows.rs @@ -12,15 +12,15 @@ use windows_sys::Win32::NetworkManagement::IpHelper::{ }; use windows_sys::Win32::NetworkManagement::Ndis::IfOperStatusUp; use windows_sys::Win32::Networking::WinSock::{ - AF_INET, AF_INET6, AF_UNSPEC, NI_NAMEREQD, NI_NUMERICHOST, SOCKADDR, SOCKADDR_IN6, SOCK_DGRAM, + AF_INET, AF_INET6, AF_UNSPEC, NI_NAMEREQD, NI_NUMERICHOST, SOCK_DGRAM, SOCKADDR, SOCKADDR_IN6, WSAHOST_NOT_FOUND, }; use crate::errors::HostNameError; use crate::net::{ - domain_name, fully_qualified_dns_name, get_name_info, host_name, in6_is_addr_linklocal, - in6_is_addr_mc_linklocal, short_host_name, AdapterUnicastAddressIter, AddressInfo, - InterfaceAddresses, + AdapterUnicastAddressIter, AddressInfo, InterfaceAddresses, domain_name, + fully_qualified_dns_name, get_name_info, host_name, in6_is_addr_linklocal, + in6_is_addr_mc_linklocal, short_host_name, }; use crate::print::{ AliasHostName, AllFqdnHostName, AllIpAddressesHostName, DefaultHostName, DomainHostName,