From e99f350c6712411af871028a55098aba8ad109bb Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Tue, 5 May 2020 12:14:17 +0200 Subject: [PATCH] Change wrong structures names --- rust-code-analysis-cli/src/main.rs | 4 ++-- src/spaces.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust-code-analysis-cli/src/main.rs b/rust-code-analysis-cli/src/main.rs index 8b5a914ce..3efa94a8c 100644 --- a/rust-code-analysis-cli/src/main.rs +++ b/rust-code-analysis-cli/src/main.rs @@ -78,7 +78,7 @@ fn act_on_file(language: Option, path: PathBuf, cfg: &Config) -> std::io:: }; action::(&language, source, &path, pr, cfg) } else if cfg.metrics { - let cfg = SpacesCfg { + let cfg = MetricsCfg { path, pretty: cfg.pretty, output_path: if cfg.output.is_empty() { @@ -87,7 +87,7 @@ fn act_on_file(language: Option, path: PathBuf, cfg: &Config) -> std::io:: Some(PathBuf::from(cfg.output.clone())) }, }; - action::(&language, source, &cfg.path.clone(), pr, cfg) + action::(&language, source, &cfg.path.clone(), pr, cfg) } else if cfg.comments { let cfg = CommentRmCfg { in_place: cfg.in_place, diff --git a/src/spaces.rs b/src/spaces.rs index 849f0a987..d88e90432 100644 --- a/src/spaces.rs +++ b/src/spaces.rs @@ -517,17 +517,17 @@ pub fn metrics<'a, T: TSParserTrait>(parser: &'a T, path: &'a PathBuf) -> Option }) } -pub struct SpacesCfg { +pub struct MetricsCfg { pub path: PathBuf, pub pretty: bool, pub output_path: Option, } -pub struct Spaces {} +pub struct Metrics {} -impl Callback for Spaces { +impl Callback for Metrics { type Res = std::io::Result<()>; - type Cfg = SpacesCfg; + type Cfg = MetricsCfg; fn call(cfg: Self::Cfg, parser: &T) -> Self::Res { if let Some(space) = metrics(parser, &cfg.path) {