mirror of
https://github.com/uutils/coreutils
synced 2024-10-15 04:14:44 +00:00
all: remove explicit imports of TryFrom and TryInto
This is enabled by the changing the edition from 2018 to 2021
This commit is contained in:
parent
af9f718936
commit
c6c936f529
|
@ -23,7 +23,6 @@ mod blocks;
|
||||||
use blocks::conv_block_unblock_helper;
|
use blocks::conv_block_unblock_helper;
|
||||||
|
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::{File, OpenOptions};
|
use std::fs::{File, OpenOptions};
|
||||||
use std::io::{self, Read, Seek, Write};
|
use std::io::{self, Read, Seek, Write};
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
// spell-checker:ignore (vars) zlines BUFWRITER seekable
|
// spell-checker:ignore (vars) zlines BUFWRITER seekable
|
||||||
|
|
||||||
use clap::{crate_version, Arg, ArgMatches, Command};
|
use clap::{crate_version, Arg, ArgMatches, Command};
|
||||||
use std::convert::{TryFrom, TryInto};
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write};
|
use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write};
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
|
|
|
@ -29,7 +29,6 @@ mod prn_float;
|
||||||
mod prn_int;
|
mod prn_int;
|
||||||
|
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::convert::TryFrom;
|
|
||||||
|
|
||||||
use crate::byteorder_io::*;
|
use crate::byteorder_io::*;
|
||||||
use crate::formatteriteminfo::*;
|
use crate::formatteriteminfo::*;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
//!
|
//!
|
||||||
//! This module provides an implementation of [`FromStr`] for the
|
//! This module provides an implementation of [`FromStr`] for the
|
||||||
//! [`PreciseNumber`] struct.
|
//! [`PreciseNumber`] struct.
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use bigdecimal::BigDecimal;
|
use bigdecimal::BigDecimal;
|
||||||
|
|
|
@ -33,7 +33,6 @@ use numeric_str_cmp::{human_numeric_str_cmp, numeric_str_cmp, NumInfo, NumInfoPa
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::convert::TryFrom;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::ffi::{OsStr, OsString};
|
use std::ffi::{OsStr, OsString};
|
||||||
|
|
|
@ -14,7 +14,6 @@ mod platform;
|
||||||
use crate::filenames::FilenameIterator;
|
use crate::filenames::FilenameIterator;
|
||||||
use crate::filenames::SuffixType;
|
use crate::filenames::SuffixType;
|
||||||
use clap::{crate_version, Arg, ArgMatches, Command};
|
use clap::{crate_version, Arg, ArgMatches, Command};
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fs::{metadata, File};
|
use std::fs::{metadata, File};
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
|
||||||
use clap::{crate_version, Arg, ArgMatches, Command};
|
use clap::{crate_version, Arg, ArgMatches, Command};
|
||||||
use std::convert::{TryFrom, TryInto};
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
use std::os::unix::process::ExitStatusExt;
|
use std::os::unix::process::ExitStatusExt;
|
||||||
|
|
|
@ -22,7 +22,6 @@ use chunks::ReverseChunks;
|
||||||
|
|
||||||
use clap::{Arg, Command};
|
use clap::{Arg, Command};
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fs::{File, Metadata};
|
use std::fs::{File, Metadata};
|
||||||
|
|
|
@ -41,7 +41,6 @@ use libc::{c_char, c_int, gid_t, uid_t};
|
||||||
use libc::{getgrgid, getgrnam, getgroups};
|
use libc::{getgrgid, getgrnam, getgroups};
|
||||||
use libc::{getpwnam, getpwuid, group, passwd};
|
use libc::{getpwnam, getpwuid, group, passwd};
|
||||||
|
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::{CStr, CString};
|
||||||
use std::io::Error as IOError;
|
use std::io::Error as IOError;
|
||||||
use std::io::ErrorKind;
|
use std::io::ErrorKind;
|
||||||
|
|
|
@ -99,8 +99,6 @@ impl FileInformation {
|
||||||
pub fn file_size(&self) -> u64 {
|
pub fn file_size(&self) -> u64 {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
use std::convert::TryInto;
|
|
||||||
|
|
||||||
assert!(self.0.st_size >= 0, "File size is negative");
|
assert!(self.0.st_size >= 0, "File size is negative");
|
||||||
self.0.st_size.try_into().unwrap()
|
self.0.st_size.try_into().unwrap()
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
// spell-checker:ignore (ToDO) hdsf ghead gtail
|
// spell-checker:ignore (ToDO) hdsf ghead gtail
|
||||||
|
|
||||||
use std::convert::TryFrom;
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use array_init::array_init;
|
use array_init::array_init;
|
||||||
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
|
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
|
||||||
use std::convert::TryInto;
|
|
||||||
use uu_factor::{table::*, Factors};
|
use uu_factor::{table::*, Factors};
|
||||||
|
|
||||||
fn table(c: &mut Criterion) {
|
fn table(c: &mut Criterion) {
|
||||||
|
|
Loading…
Reference in a new issue