mirror of
https://github.com/sharkdp/bat
synced 2024-11-18 15:26:16 +00:00
Fix all compile warnings in lib.rs
This commit is contained in:
parent
cfd33168af
commit
710a1df4ff
39
src/lib.rs
39
src/lib.rs
@ -4,9 +4,6 @@
|
||||
#[macro_use]
|
||||
extern crate error_chain;
|
||||
|
||||
#[macro_use]
|
||||
extern crate clap;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
@ -21,17 +18,17 @@ extern crate shell_words;
|
||||
extern crate syntect;
|
||||
extern crate wild;
|
||||
|
||||
mod assets;
|
||||
mod config;
|
||||
mod diff;
|
||||
mod dirs;
|
||||
mod inputfile;
|
||||
mod line_range;
|
||||
mod preprocessor;
|
||||
mod style;
|
||||
mod syntax_mapping;
|
||||
mod terminal;
|
||||
mod util;
|
||||
pub mod assets;
|
||||
pub mod config;
|
||||
pub mod diff;
|
||||
pub mod dirs;
|
||||
pub mod inputfile;
|
||||
pub mod line_range;
|
||||
pub mod preprocessor;
|
||||
pub mod style;
|
||||
pub mod syntax_mapping;
|
||||
pub mod terminal;
|
||||
pub mod util;
|
||||
|
||||
mod errors {
|
||||
error_chain! {
|
||||
@ -42,18 +39,4 @@ mod errors {
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user