mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-18 18:00:35 +01:00
Move error macros to error.rs
This commit is contained in:
parent
65096a653e
commit
a3060f952e
3 changed files with 12 additions and 12 deletions
10
src/error.rs
Normal file
10
src/error.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
macro_rules! print_error {
|
||||
($($arg:tt)*) => (eprintln!("[fd error]: {}", format!($($arg)*)))
|
||||
}
|
||||
|
||||
macro_rules! print_error_and_exit {
|
||||
($($arg:tt)*) => {
|
||||
print_error!($($arg)*);
|
||||
::std::process::exit(1);
|
||||
};
|
||||
}
|
|
@ -4,17 +4,6 @@ use std::ffi::{OsStr, OsString};
|
|||
use regex_syntax::hir::Hir;
|
||||
use regex_syntax::ParserBuilder;
|
||||
|
||||
macro_rules! print_error {
|
||||
($($arg:tt)*) => (eprintln!("[fd error]: {}", format!($($arg)*)))
|
||||
}
|
||||
|
||||
macro_rules! print_error_and_exit {
|
||||
($($arg:tt)*) => {
|
||||
print_error!($($arg)*);
|
||||
::std::process::exit(1);
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(any(unix, target_os = "redox"))]
|
||||
pub fn osstr_to_bytes(input: &OsStr) -> Cow<[u8]> {
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#[macro_use]
|
||||
mod internal;
|
||||
mod error;
|
||||
|
||||
mod app;
|
||||
mod exec;
|
||||
|
@ -7,6 +7,7 @@ mod exit_codes;
|
|||
mod filetypes;
|
||||
mod filter;
|
||||
mod fshelper;
|
||||
mod internal;
|
||||
mod options;
|
||||
mod output;
|
||||
mod walk;
|
||||
|
|
Loading…
Reference in a new issue