Merge pull request #2479 from sylvestre/clip2

Fix some clippy warnings
This commit is contained in:
Sylvestre Ledru 2021-07-06 18:35:51 +02:00 committed by GitHub
commit 2a6fe0fd3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -5,6 +5,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
#![allow(clippy::nonstandard_macro_braces)]
#[macro_use]
extern crate uucore;

View file

@ -7,6 +7,9 @@
// spell-checker:ignore (ToDO) gethostid
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
#![allow(clippy::nonstandard_macro_braces)]
#[macro_use]
extern crate uucore;

View file

@ -7,6 +7,9 @@
// spell-checker:ignore (ToDO) MAKEWORD addrs hashset
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
#![allow(clippy::nonstandard_macro_braces)]
#[macro_use]
extern crate uucore;
@ -14,6 +17,8 @@ use clap::{crate_version, App, Arg, ArgMatches};
use std::collections::hash_set::HashSet;
use std::net::ToSocketAddrs;
use std::str;
#[cfg(windows)]
use uucore::error::UUsageError;
use uucore::error::{UResult, USimpleError};
#[cfg(windows)]
@ -37,7 +42,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
#[allow(deprecated)]
let mut data = std::mem::uninitialized();
if WSAStartup(MAKEWORD(2, 2), &mut data as *mut _) != 0 {
return Err(USimpleError::new(1, format!("Failed to start Winsock 2.2")));
return Err(UUsageError::new(
1,
"Failed to start Winsock 2.2".to_string(),
));
}
}
let result = execute(args);