diff options
author | Akshay <[email protected]> | 2021-11-20 13:26:26 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-11-28 07:55:23 +0000 |
commit | 2b6012a79cb092e5d88c050cb494057efef28fc2 (patch) | |
tree | cd31973c32431a5cbf8c12ce574f799d065852be /bin/src/explain.rs | |
parent | 4e063b2abc402ac4d6902647e821978269025c7d (diff) |
introduce --config flag
Diffstat (limited to 'bin/src/explain.rs')
-rw-r--r-- | bin/src/explain.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/src/explain.rs b/bin/src/explain.rs index de171aa..bcb8eed 100644 --- a/bin/src/explain.rs +++ b/bin/src/explain.rs | |||
@@ -1,11 +1,10 @@ | |||
1 | use crate::err::ExplainErr; | 1 | use crate::{err::ExplainErr, utils}; |
2 | |||
3 | use lib::LINTS; | ||
4 | 2 | ||
5 | pub fn explain(code: u32) -> Result<&'static str, ExplainErr> { | 3 | pub fn explain(code: u32) -> Result<&'static str, ExplainErr> { |
4 | let lints = utils::lint_map(); | ||
6 | match code { | 5 | match code { |
7 | 0 => Ok("syntax error"), | 6 | 0 => Ok("syntax error"), |
8 | _ => LINTS | 7 | _ => lints |
9 | .values() | 8 | .values() |
10 | .flatten() | 9 | .flatten() |
11 | .find(|l| l.code() == code) | 10 | .find(|l| l.code() == code) |