Use .to_string() instead of .description()

This commit is contained in:
sharkdp 2020-03-22 15:54:43 +01:00
parent e5e14f31c4
commit 44605d55dd
2 changed files with 4 additions and 7 deletions

View File

@ -17,7 +17,6 @@ mod output;
mod walk; mod walk;
use std::env; use std::env;
use std::error::Error;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process; use std::process;
use std::sync::Arc; use std::sync::Arc;
@ -263,7 +262,7 @@ fn main() {
{ {
Ok(re) => re, Ok(re) => re,
Err(err) => { Err(err) => {
print_error_and_exit!("{}", err.description()); print_error_and_exit!("{}", err.to_string());
} }
} }
}), }),
@ -295,7 +294,7 @@ fn main() {
print_error_and_exit!( print_error_and_exit!(
"{}\nHint: You can use the '--fixed-strings' option to search for a \ "{}\nHint: You can use the '--fixed-strings' option to search for a \
literal string instead of a regular expression", literal string instead of a regular expression",
err.description() err.to_string()
); );
} }
} }

View File

@ -13,7 +13,6 @@ use crate::internal::{opts::FdOptions, osstr_to_bytes, MAX_BUFFER_LENGTH};
use crate::output; use crate::output;
use std::borrow::Cow; use std::borrow::Cow;
use std::error::Error;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fs::{FileType, Metadata}; use std::fs::{FileType, Metadata};
use std::io; use std::io;
@ -95,9 +94,8 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) -
print_error!( print_error!(
"{}", "{}",
format!( format!(
"Malformed pattern in custom ignore file '{}': {}.", "Malformed pattern in custom ignore file. {}.",
ignore_file.to_string_lossy(), err.to_string()
err.description()
) )
); );
} }