on master help sign in
Fix all compile warnings in lib.rs
710a1dfFahmi Akbar Wildana
src/lib.rs+11−28
@@ -4,9 +4,6 @@
4#[macro_use]
4#[macro_use]
5extern crate error_chain;
5extern crate error_chain;
6
6
7−#[macro_use]
8−extern crate clap;
9−
10#[macro_use]
7#[macro_use]
11extern crate lazy_static;
8extern crate lazy_static;
12
9
@@ -21,17 +18,17 @@ extern crate shell_words;
21extern crate syntect;
18extern crate syntect;
22extern crate wild;
19extern crate wild;
23
20
24−mod assets;
21+pub mod assets;
25−mod config;
22+pub mod config;
26−mod diff;
23+pub mod diff;
27−mod dirs;
24+pub mod dirs;
28−mod inputfile;
25+pub mod inputfile;
29−mod line_range;
26+pub mod line_range;
30−mod preprocessor;
27+pub mod preprocessor;
31−mod style;
28+pub mod style;
32−mod syntax_mapping;
29+pub mod syntax_mapping;
33−mod terminal;
30+pub mod terminal;
34−mod util;
31+pub mod util;
35
32
36mod errors {
33mod errors {
37 error_chain! {
34 error_chain! {
@@ -42,18 +39,4 @@ mod errors {
42 ParseIntError(::std::num::ParseIntError);
39 ParseIntError(::std::num::ParseIntError);
43 }
40 }
44 }
41 }
45−
46− pub fn handle_error(error: &Error) {
47− match error {
48− Error(ErrorKind::Io(ref io_error), _)
49− if io_error.kind() == ::std::io::ErrorKind::BrokenPipe =>
50− {
51− ::std::process::exit(0);
52− }
53− _ => {
54− use ansi_term::Colour::Red;
55− eprintln!("{}: {}", Red.paint("[bat error]"), error);
56− }
57− };
58− }
59}
42}