2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-04 18:00:24 +00:00

Fix all compile warnings in lib.rs

This commit is contained in:
Fahmi Akbar Wildana 2019-10-06 09:18:08 +07:00 committed by David Peter
parent cfd33168af
commit 710a1df4ff

View File

@ -4,9 +4,6 @@
#[macro_use] #[macro_use]
extern crate error_chain; extern crate error_chain;
#[macro_use]
extern crate clap;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
@ -21,17 +18,17 @@ extern crate shell_words;
extern crate syntect; extern crate syntect;
extern crate wild; extern crate wild;
mod assets; pub mod assets;
mod config; pub mod config;
mod diff; pub mod diff;
mod dirs; pub mod dirs;
mod inputfile; pub mod inputfile;
mod line_range; pub mod line_range;
mod preprocessor; pub mod preprocessor;
mod style; pub mod style;
mod syntax_mapping; pub mod syntax_mapping;
mod terminal; pub mod terminal;
mod util; pub mod util;
mod errors { mod errors {
error_chain! { error_chain! {
@ -42,18 +39,4 @@ mod errors {
ParseIntError(::std::num::ParseIntError); ParseIntError(::std::num::ParseIntError);
} }
} }
pub fn handle_error(error: &Error) {
match error {
Error(ErrorKind::Io(ref io_error), _)
if io_error.kind() == ::std::io::ErrorKind::BrokenPipe =>
{
::std::process::exit(0);
}
_ => {
use ansi_term::Colour::Red;
eprintln!("{}: {}", Red.paint("[bat error]"), error);
}
};
}
} }