mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3805 from cakebaker/clippy_deriving_eq
Fix clippy warnings with Rust 1.63
This commit is contained in:
commit
fc14c6e7a9
8 changed files with 15 additions and 11 deletions
|
@ -49,7 +49,7 @@ use winapi::um::minwinbase::{FileIdInfo, FileStandardInfo};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use winapi::um::winbase::GetFileInformationByHandleEx;
|
use winapi::um::winbase::GetFileInformationByHandleEx;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use winapi::um::winnt::{FILE_ID_128, ULONGLONG};
|
use winapi::um::winnt::FILE_ID_128;
|
||||||
|
|
||||||
mod options {
|
mod options {
|
||||||
pub const HELP: &str = "help";
|
pub const HELP: &str = "help";
|
||||||
|
@ -254,7 +254,7 @@ fn get_file_info(path: &Path) -> Option<FileInfo> {
|
||||||
if success != 0 {
|
if success != 0 {
|
||||||
result = Some(FileInfo {
|
result = Some(FileInfo {
|
||||||
file_id: std::mem::transmute::<FILE_ID_128, u128>(file_info.FileId),
|
file_id: std::mem::transmute::<FILE_ID_128, u128>(file_info.FileId),
|
||||||
dev_id: std::mem::transmute::<ULONGLONG, u64>(file_info.VolumeSerialNumber),
|
dev_id: file_info.VolumeSerialNumber,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ impl RoundMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Represents the options extracted from the --format argument provided by the user.
|
// Represents the options extracted from the --format argument provided by the user.
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub struct FormatOptions {
|
pub struct FormatOptions {
|
||||||
pub grouping: bool,
|
pub grouping: bool,
|
||||||
pub padding: Option<isize>,
|
pub padding: Option<isize>,
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub const IEC_BASES: [f64; 10] = [
|
||||||
|
|
||||||
pub type WithI = bool;
|
pub type WithI = bool;
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq)]
|
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum Unit {
|
pub enum Unit {
|
||||||
Auto,
|
Auto,
|
||||||
Si,
|
Si,
|
||||||
|
|
|
@ -491,7 +491,7 @@ fn pathbuf_from_stdout() -> UResult<PathBuf> {
|
||||||
// to a u32.
|
// to a u32.
|
||||||
let ret = unsafe {
|
let ret = unsafe {
|
||||||
GetFinalPathNameByHandleW(
|
GetFinalPathNameByHandleW(
|
||||||
std::mem::transmute(handle),
|
handle,
|
||||||
file_path_buffer.as_mut_ptr(),
|
file_path_buffer.as_mut_ptr(),
|
||||||
file_path_buffer.len() as u32,
|
file_path_buffer.len() as u32,
|
||||||
FILE_NAME_OPENED,
|
FILE_NAME_OPENED,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// TODO fix broken links
|
||||||
|
#![allow(rustdoc::broken_intra_doc_links)]
|
||||||
//! Macros for the uucore utilities.
|
//! Macros for the uucore utilities.
|
||||||
//!
|
//!
|
||||||
//! This module bundles all macros used across the uucore utilities. These
|
//! This module bundles all macros used across the uucore utilities. These
|
||||||
|
@ -28,7 +30,7 @@
|
||||||
//! - Terminate util execution
|
//! - Terminate util execution
|
||||||
//! - Crash program: [`crash!`], [`crash_if_err!`]
|
//! - Crash program: [`crash!`], [`crash_if_err!`]
|
||||||
|
|
||||||
// spell-checker:ignore sourcepath targetpath
|
// spell-checker:ignore sourcepath targetpath rustdoc
|
||||||
|
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// TODO fix broken links
|
||||||
|
#![allow(rustdoc::broken_intra_doc_links)]
|
||||||
//! All utils return exit with an exit code. Usually, the following scheme is used:
|
//! All utils return exit with an exit code. Usually, the following scheme is used:
|
||||||
//! * `0`: succeeded
|
//! * `0`: succeeded
|
||||||
//! * `1`: minor problems
|
//! * `1`: minor problems
|
||||||
|
@ -48,7 +50,7 @@
|
||||||
//! * Using [`ExitCode`] is not recommended but can be useful for converting utils to use
|
//! * Using [`ExitCode`] is not recommended but can be useful for converting utils to use
|
||||||
//! [`UResult`].
|
//! [`UResult`].
|
||||||
|
|
||||||
// spell-checker:ignore uioerror
|
// spell-checker:ignore uioerror rustdoc
|
||||||
|
|
||||||
use clap;
|
use clap;
|
||||||
use std::{
|
use std::{
|
||||||
|
|
|
@ -404,8 +404,8 @@ fn test_with_pr_core_utils_tests() {
|
||||||
for test_case in test_cases {
|
for test_case in test_cases {
|
||||||
let (flags, input_file, expected_file, return_code) = test_case;
|
let (flags, input_file, expected_file, return_code) = test_case;
|
||||||
let mut scenario = new_ucmd!();
|
let mut scenario = new_ucmd!();
|
||||||
let input_file_path = input_file.get(0).unwrap();
|
let input_file_path = input_file.first().unwrap();
|
||||||
let test_file_path = expected_file.get(0).unwrap();
|
let test_file_path = expected_file.first().unwrap();
|
||||||
let value = file_last_modified_time(&scenario, test_file_path);
|
let value = file_last_modified_time(&scenario, test_file_path);
|
||||||
let mut arguments: Vec<&str> = flags
|
let mut arguments: Vec<&str> = flags
|
||||||
.split(' ')
|
.split(' ')
|
||||||
|
|
|
@ -982,7 +982,7 @@ impl UCommand {
|
||||||
tmpd: Rc<TempDir>,
|
tmpd: Rc<TempDir>,
|
||||||
env_clear: bool,
|
env_clear: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let tmpd_path_buf = String::from(&(*tmpd.as_ref().path().to_str().unwrap()));
|
let tmpd_path_buf = String::from(tmpd.as_ref().path().to_str().unwrap());
|
||||||
let mut ucmd: Self = Self::new(bin_path, util_name, tmpd_path_buf, env_clear);
|
let mut ucmd: Self = Self::new(bin_path, util_name, tmpd_path_buf, env_clear);
|
||||||
ucmd.tmpd = Some(tmpd);
|
ucmd.tmpd = Some(tmpd);
|
||||||
ucmd
|
ucmd
|
||||||
|
@ -1296,7 +1296,7 @@ pub fn check_coreutil_version(
|
||||||
std::str::from_utf8(&version_check.stdout).unwrap()
|
std::str::from_utf8(&version_check.stdout).unwrap()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.get(0)
|
.first()
|
||||||
.map_or_else(
|
.map_or_else(
|
||||||
|| Err(format!("{}: unexpected output format for reference coreutil: '{} --version'", UUTILS_WARNING, util_name)),
|
|| Err(format!("{}: unexpected output format for reference coreutil: '{} --version'", UUTILS_WARNING, util_name)),
|
||||||
|s| {
|
|s| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue