From 324a333e671ed521138ad50fe463ed187874176e Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 6 Nov 2021 14:51:55 +0530 Subject: introducing "streaming" option to check, fix and single --- bin/src/explain.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin/src/explain.rs') diff --git a/bin/src/explain.rs b/bin/src/explain.rs index 6aefa7e..de171aa 100644 --- a/bin/src/explain.rs +++ b/bin/src/explain.rs @@ -13,3 +13,14 @@ pub fn explain(code: u32) -> Result<&'static str, ExplainErr> { .ok_or(ExplainErr::LintNotFound(code)), } } + +pub mod main { + + use crate::{config::Explain as ExplainConfig, err::StatixErr}; + + pub fn main(explain_config: ExplainConfig) -> Result<(), StatixErr> { + let explanation = super::explain(explain_config.target)?; + println!("{}", explanation); + Ok(()) + } +} -- cgit v1.2.3