Skip to content

Commit

Permalink
Change wrong structures names
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 committed May 5, 2020
1 parent c7589fa commit e99f350
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rust-code-analysis-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn act_on_file(language: Option<LANG>, path: PathBuf, cfg: &Config) -> std::io::
};
action::<Dump>(&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() {
Expand All @@ -87,7 +87,7 @@ fn act_on_file(language: Option<LANG>, path: PathBuf, cfg: &Config) -> std::io::
Some(PathBuf::from(cfg.output.clone()))
},
};
action::<Spaces>(&language, source, &cfg.path.clone(), pr, cfg)
action::<Metrics>(&language, source, &cfg.path.clone(), pr, cfg)
} else if cfg.comments {
let cfg = CommentRmCfg {
in_place: cfg.in_place,
Expand Down
8 changes: 4 additions & 4 deletions src/spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf>,
}

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<T: TSParserTrait>(cfg: Self::Cfg, parser: &T) -> Self::Res {
if let Some(space) = metrics(parser, &cfg.path) {
Expand Down

0 comments on commit e99f350

Please sign in to comment.