mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-03 14:37:45 +00:00
refactor/polish ~ fix cargo clippy
complaints (deprecated std::error::Error::description)
This commit is contained in:
parent
0635c5fe93
commit
ce0bb218a7
4 changed files with 6 additions and 7 deletions
|
@ -9,7 +9,7 @@ name = "uu_cat"
|
|||
path = "cat.rs"
|
||||
|
||||
[dependencies]
|
||||
quick-error = "1.2.2"
|
||||
quick-error = "1.2.3"
|
||||
|
||||
[dependencies.uucore]
|
||||
version = "0.0.1"
|
||||
|
|
|
@ -16,7 +16,7 @@ getopts = "0.2.18"
|
|||
libc = "0.2.42"
|
||||
walkdir = "2.2.8"
|
||||
clap = "2.32.0"
|
||||
quick-error = "1.2.2"
|
||||
quick-error = "1.2.3"
|
||||
filetime = "0.2"
|
||||
|
||||
[dependencies.uucore]
|
||||
|
|
|
@ -141,7 +141,6 @@ pub fn pretty_access(mode: mode_t) -> String {
|
|||
|
||||
use std::borrow::Cow;
|
||||
use std::convert::{AsRef, From};
|
||||
use std::error::Error;
|
||||
use std::ffi::CString;
|
||||
use std::io::Error as IOError;
|
||||
use std::mem;
|
||||
|
@ -290,7 +289,7 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
Err(e) => Err(e.description().to_owned()),
|
||||
Err(e) => Err(e.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
|||
match parse_size(slice) {
|
||||
Ok(m) => settings.mode = FilterMode::Lines(m, b'\n'),
|
||||
Err(e) => {
|
||||
show_error!("{}", e.description());
|
||||
show_error!("{}", e.to_string());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
|||
match parse_size(slice) {
|
||||
Ok(m) => settings.mode = FilterMode::Bytes(m),
|
||||
Err(e) => {
|
||||
show_error!("{}", e.description());
|
||||
show_error!("{}", e.to_string());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ impl Error for ParseSizeErr {
|
|||
|
||||
impl fmt::Display for ParseSizeErr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
write!(f, "{}", Error::description(self))
|
||||
write!(f, "{}", self.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue