fix: Only check filename, not parent dirs

This commit is contained in:
Ed Page 2020-03-30 10:24:15 -05:00 committed by Ed Page
parent 94ee49b068
commit 54aaffed49

View file

@ -235,7 +235,7 @@ impl Checks {
return Ok(typos_found);
}
for part in path.components().filter_map(|c| c.as_os_str().to_str()) {
if let Some(part) = path.file_name().and_then(|s| s.to_str()) {
for ident in parser.parse(part) {
if let Some(correction) = dictionary.correct_ident(ident) {
let msg = report::FilenameCorrection {