mirror of
https://github.com/crate-ci/typos.git
synced 2026-11-18 03:34:07 +01:00
refactor(report): Rename source field
This commit is contained in:
1 parent
859769b835
commit
b12e90c141
2 files changed
+6
-6
No files matched your search
+2
-2
@@ -29,7 +29,7 @@ pub fn process_file(
|
||||
line,
|
||||
line_num,
|
||||
col_num,
|
||||
word: ident.token(),
|
||||
typo: ident.token(),
|
||||
correction,
|
||||
non_exhaustive: (),
|
||||
};
|
||||
@@ -43,7 +43,7 @@ pub fn process_file(
|
||||
line,
|
||||
line_num,
|
||||
col_num,
|
||||
word: word.token(),
|
||||
typo: word.token(),
|
||||
correction,
|
||||
non_exhaustive: (),
|
||||
};
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ pub struct Message<'m> {
|
||||
pub line: &'m [u8],
|
||||
pub line_num: usize,
|
||||
pub col_num: usize,
|
||||
pub word: &'m str,
|
||||
pub typo: &'m str,
|
||||
pub correction: &'m str,
|
||||
#[serde(skip)]
|
||||
pub(crate) non_exhaustive: (),
|
||||
@@ -23,7 +23,7 @@ pub fn print_brief(msg: Message) {
|
||||
msg.path.display(),
|
||||
msg.line_num,
|
||||
msg.col_num,
|
||||
msg.word,
|
||||
msg.typo,
|
||||
msg.correction
|
||||
);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ pub fn print_long(msg: Message) {
|
||||
let line_indent: String = itertools::repeat_n(" ", line_num.len()).collect();
|
||||
|
||||
let hl_indent: String = itertools::repeat_n(" ", msg.col_num).collect();
|
||||
let hl: String = itertools::repeat_n("^", msg.word.len()).collect();
|
||||
let hl: String = itertools::repeat_n("^", msg.typo.len()).collect();
|
||||
|
||||
let line = String::from_utf8_lossy(msg.line);
|
||||
let line = line.replace("\t", " ");
|
||||
@@ -44,7 +44,7 @@ pub fn print_long(msg: Message) {
|
||||
writeln!(
|
||||
handle,
|
||||
"error: `{}` should be `{}`",
|
||||
msg.word, msg.correction
|
||||
msg.typo, msg.correction
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(
|
||||
|
||||
Reference in new issue
Block a user