fix: Make reports name clearer

This commit is contained in:
Ed Page 2020-03-30 19:43:38 -05:00 committed by Ed Page
parent 54aaffed49
commit f94c8c008f
2 changed files with 6 additions and 6 deletions

View file

@ -238,7 +238,7 @@ impl Checks {
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 {
let msg = report::PathCorrection {
path,
typo: ident.token(),
correction,
@ -249,7 +249,7 @@ impl Checks {
} else {
for word in ident.split() {
if let Some(correction) = dictionary.correct_word(word) {
let msg = report::FilenameCorrection {
let msg = report::PathCorrection {
path,
typo: word.token(),
correction,

View file

@ -7,7 +7,7 @@ use std::io::{self, Write};
pub enum Message<'m> {
BinaryFile(BinaryFile<'m>),
Correction(Correction<'m>),
FilenameCorrection(FilenameCorrection<'m>),
PathCorrection(PathCorrection<'m>),
File(File<'m>),
Parse(Parse<'m>),
PathError(PathError<'m>),
@ -38,7 +38,7 @@ pub struct Correction<'m> {
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct FilenameCorrection<'m> {
pub struct PathCorrection<'m> {
pub path: &'m std::path::Path,
pub typo: &'m str,
pub correction: Cow<'m, str>,
@ -133,7 +133,7 @@ impl Report for PrintBrief {
msg.correction
);
}
Message::FilenameCorrection(msg) => {
Message::PathCorrection(msg) => {
println!("{}: {} -> {}", msg.path.display(), msg.typo, msg.correction);
}
Message::File(msg) => {
@ -165,7 +165,7 @@ impl Report for PrintLong {
println!("{}", msg);
}
Message::Correction(msg) => print_long_correction(msg),
Message::FilenameCorrection(msg) => {
Message::PathCorrection(msg) => {
println!(
"{}: error: `{}` should be `{}`",
msg.path.display(),