mirror of
https://github.com/crate-ci/typos.git
synced 2025-01-11 01:01:36 -05:00
refactor: Make room for parent function
This commit is contained in:
parent
bc90bacff2
commit
220a79ff30
2 changed files with 4 additions and 4 deletions
|
@ -171,7 +171,7 @@ fn bench_check_file(data: &str, b: &mut test::Bencher) {
|
||||||
let parser = typos::tokens::Tokenizer::new();
|
let parser = typos::tokens::Tokenizer::new();
|
||||||
let checks = typos_cli::checks::TyposSettings::new().build_typos();
|
let checks = typos_cli::checks::TyposSettings::new().build_typos();
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
checks.check_file(
|
checks.check_file_content(
|
||||||
sample_path.path(),
|
sample_path.path(),
|
||||||
true,
|
true,
|
||||||
&parser,
|
&parser,
|
||||||
|
|
|
@ -49,7 +49,7 @@ pub trait Check: Send + Sync {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_file(
|
fn check_file_content(
|
||||||
&self,
|
&self,
|
||||||
path: &std::path::Path,
|
path: &std::path::Path,
|
||||||
explicit: bool,
|
explicit: bool,
|
||||||
|
@ -401,7 +401,7 @@ impl Check for Files {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_file(
|
fn check_file_content(
|
||||||
&self,
|
&self,
|
||||||
path: &std::path::Path,
|
path: &std::path::Path,
|
||||||
_explicit: bool,
|
_explicit: bool,
|
||||||
|
@ -492,7 +492,7 @@ fn check_entry(
|
||||||
if entry.file_type().map(|t| t.is_file()).unwrap_or(true) {
|
if entry.file_type().map(|t| t.is_file()).unwrap_or(true) {
|
||||||
let explicit = entry.depth() == 0;
|
let explicit = entry.depth() == 0;
|
||||||
checks.check_filename(entry.path(), parser, dictionary, reporter)?;
|
checks.check_filename(entry.path(), parser, dictionary, reporter)?;
|
||||||
checks.check_file(entry.path(), explicit, parser, dictionary, reporter)?;
|
checks.check_file_content(entry.path(), explicit, parser, dictionary, reporter)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue