mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-22 09:01:04 -05:00
fix: Don't check words if ident gets a hit
This commit is contained in:
parent
a8629916b4
commit
ff8fce5fb6
1 changed files with 28 additions and 26 deletions
|
@ -88,7 +88,7 @@ impl<'d, 'p> Checks<'d, 'p> {
|
||||||
};
|
};
|
||||||
report(msg.into());
|
report(msg.into());
|
||||||
typos_found = true;
|
typos_found = true;
|
||||||
}
|
} else {
|
||||||
for word in ident.split() {
|
for word in ident.split() {
|
||||||
if let Some(correction) = self.dictionary.correct_word(word) {
|
if let Some(correction) = self.dictionary.correct_word(word) {
|
||||||
let msg = report::FilenameCorrection {
|
let msg = report::FilenameCorrection {
|
||||||
|
@ -103,6 +103,7 @@ impl<'d, 'p> Checks<'d, 'p> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(typos_found)
|
Ok(typos_found)
|
||||||
}
|
}
|
||||||
|
@ -145,7 +146,7 @@ impl<'d, 'p> Checks<'d, 'p> {
|
||||||
};
|
};
|
||||||
typos_found = true;
|
typos_found = true;
|
||||||
report(msg.into());
|
report(msg.into());
|
||||||
}
|
} else {
|
||||||
for word in ident.split() {
|
for word in ident.split() {
|
||||||
if let Some(correction) = self.dictionary.correct_word(word) {
|
if let Some(correction) = self.dictionary.correct_word(word) {
|
||||||
let col_num = word.offset();
|
let col_num = word.offset();
|
||||||
|
@ -164,6 +165,7 @@ impl<'d, 'p> Checks<'d, 'p> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(typos_found)
|
Ok(typos_found)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue