From 44605d55dd2edd8d3563504587ed81c45ebc2c82 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sun, 22 Mar 2020 15:54:43 +0100 Subject: [PATCH] Use .to_string() instead of .description() --- src/main.rs | 5 ++--- src/walk.rs | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 49e35eb..a186ba8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,6 @@ mod output; mod walk; use std::env; -use std::error::Error; use std::path::{Path, PathBuf}; use std::process; use std::sync::Arc; @@ -263,7 +262,7 @@ fn main() { { Ok(re) => re, 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!( "{}\nHint: You can use the '--fixed-strings' option to search for a \ literal string instead of a regular expression", - err.description() + err.to_string() ); } } diff --git a/src/walk.rs b/src/walk.rs index 1196930..68595e8 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -13,7 +13,6 @@ use crate::internal::{opts::FdOptions, osstr_to_bytes, MAX_BUFFER_LENGTH}; use crate::output; use std::borrow::Cow; -use std::error::Error; use std::ffi::OsStr; use std::fs::{FileType, Metadata}; use std::io; @@ -95,9 +94,8 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc, config: Arc) - print_error!( "{}", format!( - "Malformed pattern in custom ignore file '{}': {}.", - ignore_file.to_string_lossy(), - err.description() + "Malformed pattern in custom ignore file. {}.", + err.to_string() ) ); }