mirror of
https://github.com/crate-ci/typos.git
synced 2025-02-13 08:40:29 -05:00
refactor(report): Merge the typos types
This commit is contained in:
parent
3429b59e72
commit
3bcd8a130e
3 changed files with 187 additions and 179 deletions
|
@ -225,39 +225,38 @@ impl Checks {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut typos_found = false;
|
let mut typos_found = false;
|
||||||
for ident in path
|
if let Some(file_name) = path.file_name().and_then(|s| s.to_str()) {
|
||||||
.file_name()
|
for ident in parser.parse(file_name) {
|
||||||
.and_then(|s| s.to_str())
|
match dictionary.correct_ident(ident) {
|
||||||
.iter()
|
Some(Status::Valid) => {}
|
||||||
.flat_map(|part| parser.parse(part))
|
Some(corrections) => {
|
||||||
{
|
let byte_offset = ident.offset();
|
||||||
match dictionary.correct_ident(ident) {
|
let msg = report::Typo {
|
||||||
Some(Status::Valid) => {}
|
context: report::PathContext { path }.into(),
|
||||||
Some(corrections) => {
|
buffer: std::borrow::Cow::Borrowed(file_name.as_bytes()),
|
||||||
let byte_offset = ident.offset();
|
byte_offset,
|
||||||
let msg = report::PathTypo {
|
typo: ident.token(),
|
||||||
path,
|
corrections,
|
||||||
byte_offset,
|
};
|
||||||
typo: ident.token(),
|
typos_found |= reporter.report(msg.into());
|
||||||
corrections,
|
}
|
||||||
};
|
None => {
|
||||||
typos_found |= reporter.report(msg.into());
|
for word in ident.split() {
|
||||||
}
|
match dictionary.correct_word(word) {
|
||||||
None => {
|
Some(Status::Valid) => {}
|
||||||
for word in ident.split() {
|
Some(corrections) => {
|
||||||
match dictionary.correct_word(word) {
|
let byte_offset = word.offset();
|
||||||
Some(Status::Valid) => {}
|
let msg = report::Typo {
|
||||||
Some(corrections) => {
|
context: report::PathContext { path }.into(),
|
||||||
let byte_offset = word.offset();
|
buffer: std::borrow::Cow::Borrowed(file_name.as_bytes()),
|
||||||
let msg = report::PathTypo {
|
byte_offset,
|
||||||
path,
|
typo: word.token(),
|
||||||
byte_offset,
|
corrections,
|
||||||
typo: word.token(),
|
};
|
||||||
corrections,
|
typos_found |= reporter.report(msg.into());
|
||||||
};
|
}
|
||||||
typos_found |= reporter.report(msg.into());
|
None => {}
|
||||||
}
|
}
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,10 +295,9 @@ impl Checks {
|
||||||
Some(Status::Valid) => {}
|
Some(Status::Valid) => {}
|
||||||
Some(corrections) => {
|
Some(corrections) => {
|
||||||
let byte_offset = ident.offset();
|
let byte_offset = ident.offset();
|
||||||
let msg = report::FileTypo {
|
let msg = report::Typo {
|
||||||
path,
|
context: report::FileContext { path, line_num }.into(),
|
||||||
line,
|
buffer: std::borrow::Cow::Borrowed(line),
|
||||||
line_num,
|
|
||||||
byte_offset,
|
byte_offset,
|
||||||
typo: ident.token(),
|
typo: ident.token(),
|
||||||
corrections,
|
corrections,
|
||||||
|
@ -312,10 +310,9 @@ impl Checks {
|
||||||
Some(Status::Valid) => {}
|
Some(Status::Valid) => {}
|
||||||
Some(corrections) => {
|
Some(corrections) => {
|
||||||
let byte_offset = word.offset();
|
let byte_offset = word.offset();
|
||||||
let msg = report::FileTypo {
|
let msg = report::Typo {
|
||||||
path,
|
context: report::FileContext { path, line_num }.into(),
|
||||||
line,
|
buffer: std::borrow::Cow::Borrowed(line),
|
||||||
line_num,
|
|
||||||
byte_offset,
|
byte_offset,
|
||||||
typo: word.token(),
|
typo: word.token(),
|
||||||
corrections,
|
corrections,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#![allow(clippy::needless_update)]
|
#![allow(clippy::needless_update)]
|
||||||
|
|
||||||
|
use std::borrow::Cow;
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Serialize, derive_more::From)]
|
#[derive(Clone, Debug, serde::Serialize, derive_more::From)]
|
||||||
|
@ -8,8 +9,7 @@ use std::io::{self, Write};
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum Message<'m> {
|
pub enum Message<'m> {
|
||||||
BinaryFile(BinaryFile<'m>),
|
BinaryFile(BinaryFile<'m>),
|
||||||
FileTypo(FileTypo<'m>),
|
Typo(Typo<'m>),
|
||||||
PathTypo(PathTypo<'m>),
|
|
||||||
File(File<'m>),
|
File(File<'m>),
|
||||||
Parse(Parse<'m>),
|
Parse(Parse<'m>),
|
||||||
PathError(PathError<'m>),
|
PathError(PathError<'m>),
|
||||||
|
@ -20,8 +20,7 @@ impl<'m> Message<'m> {
|
||||||
pub fn is_correction(&self) -> bool {
|
pub fn is_correction(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Message::BinaryFile(_) => false,
|
Message::BinaryFile(_) => false,
|
||||||
Message::FileTypo(c) => c.corrections.is_correction(),
|
Message::Typo(c) => c.corrections.is_correction(),
|
||||||
Message::PathTypo(c) => c.corrections.is_correction(),
|
|
||||||
Message::File(_) => false,
|
Message::File(_) => false,
|
||||||
Message::Parse(_) => false,
|
Message::Parse(_) => false,
|
||||||
Message::PathError(_) => false,
|
Message::PathError(_) => false,
|
||||||
|
@ -32,8 +31,7 @@ impl<'m> Message<'m> {
|
||||||
pub fn is_error(&self) -> bool {
|
pub fn is_error(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Message::BinaryFile(_) => false,
|
Message::BinaryFile(_) => false,
|
||||||
Message::FileTypo(_) => false,
|
Message::Typo(_) => false,
|
||||||
Message::PathTypo(_) => false,
|
|
||||||
Message::File(_) => false,
|
Message::File(_) => false,
|
||||||
Message::Parse(_) => false,
|
Message::Parse(_) => false,
|
||||||
Message::PathError(_) => true,
|
Message::PathError(_) => true,
|
||||||
|
@ -51,22 +49,20 @@ pub struct BinaryFile<'m> {
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Serialize, derive_setters::Setters)]
|
#[derive(Clone, Debug, serde::Serialize, derive_setters::Setters)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub struct FileTypo<'m> {
|
pub struct Typo<'m> {
|
||||||
pub path: &'m std::path::Path,
|
pub context: Context<'m>,
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
pub line: &'m [u8],
|
pub buffer: Cow<'m, [u8]>,
|
||||||
pub line_num: usize,
|
|
||||||
pub byte_offset: usize,
|
pub byte_offset: usize,
|
||||||
pub typo: &'m str,
|
pub typo: &'m str,
|
||||||
pub corrections: crate::Status<'m>,
|
pub corrections: crate::Status<'m>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'m> Default for FileTypo<'m> {
|
impl<'m> Default for Typo<'m> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
path: std::path::Path::new("-"),
|
context: Context::None,
|
||||||
line: b"",
|
buffer: Cow::Borrowed(&[]),
|
||||||
line_num: 0,
|
|
||||||
byte_offset: 0,
|
byte_offset: 0,
|
||||||
typo: "",
|
typo: "",
|
||||||
corrections: crate::Status::Invalid,
|
corrections: crate::Status::Invalid,
|
||||||
|
@ -74,22 +70,56 @@ impl<'m> Default for FileTypo<'m> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Serialize, derive_setters::Setters)]
|
#[derive(Clone, Debug, serde::Serialize, derive_more::From)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub struct PathTypo<'m> {
|
pub enum Context<'m> {
|
||||||
pub path: &'m std::path::Path,
|
File(FileContext<'m>),
|
||||||
pub byte_offset: usize,
|
Path(PathContext<'m>),
|
||||||
pub typo: &'m str,
|
None,
|
||||||
pub corrections: crate::Status<'m>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'m> Default for PathTypo<'m> {
|
impl<'m> Default for Context<'m> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Context::None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'m> std::fmt::Display for Context<'m> {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
|
||||||
|
match self {
|
||||||
|
Context::File(c) => write!(f, "{}:{}", c.path.display(), c.line_num),
|
||||||
|
Context::Path(c) => write!(f, "{}", c.path.display()),
|
||||||
|
Context::None => Ok(()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, serde::Serialize, derive_setters::Setters)]
|
||||||
|
#[non_exhaustive]
|
||||||
|
pub struct FileContext<'m> {
|
||||||
|
pub path: &'m std::path::Path,
|
||||||
|
pub line_num: usize,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'m> Default for FileContext<'m> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
path: std::path::Path::new("-"),
|
||||||
|
line_num: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, serde::Serialize, derive_setters::Setters)]
|
||||||
|
#[non_exhaustive]
|
||||||
|
pub struct PathContext<'m> {
|
||||||
|
pub path: &'m std::path::Path,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'m> Default for PathContext<'m> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
path: std::path::Path::new("-"),
|
path: std::path::Path::new("-"),
|
||||||
byte_offset: 0,
|
|
||||||
typo: "",
|
|
||||||
corrections: crate::Status::Invalid,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,42 +225,7 @@ impl Report for PrintBrief {
|
||||||
Message::BinaryFile(msg) => {
|
Message::BinaryFile(msg) => {
|
||||||
log::info!("{}", msg);
|
log::info!("{}", msg);
|
||||||
}
|
}
|
||||||
Message::FileTypo(msg) => match &msg.corrections {
|
Message::Typo(msg) => print_brief_correction(msg),
|
||||||
crate::Status::Valid => {}
|
|
||||||
crate::Status::Invalid => {
|
|
||||||
println!(
|
|
||||||
"{}:{}:{}: {} is disallowed",
|
|
||||||
msg.path.display(),
|
|
||||||
msg.line_num,
|
|
||||||
msg.byte_offset,
|
|
||||||
msg.typo,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
crate::Status::Corrections(corrections) => {
|
|
||||||
println!(
|
|
||||||
"{}:{}:{}: {} -> {}",
|
|
||||||
msg.path.display(),
|
|
||||||
msg.line_num,
|
|
||||||
msg.byte_offset,
|
|
||||||
msg.typo,
|
|
||||||
itertools::join(corrections.iter(), ", ")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Message::PathTypo(msg) => match &msg.corrections {
|
|
||||||
crate::Status::Valid => {}
|
|
||||||
crate::Status::Invalid => {
|
|
||||||
println!("{}: {} is disallowed", msg.path.display(), msg.typo,);
|
|
||||||
}
|
|
||||||
crate::Status::Corrections(corrections) => {
|
|
||||||
println!(
|
|
||||||
"{}: {} -> {}",
|
|
||||||
msg.path.display(),
|
|
||||||
msg.typo,
|
|
||||||
itertools::join(corrections.iter(), ", ")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Message::File(msg) => {
|
Message::File(msg) => {
|
||||||
println!("{}", msg.path.display());
|
println!("{}", msg.path.display());
|
||||||
}
|
}
|
||||||
|
@ -257,25 +252,7 @@ impl Report for PrintLong {
|
||||||
Message::BinaryFile(msg) => {
|
Message::BinaryFile(msg) => {
|
||||||
log::info!("{}", msg);
|
log::info!("{}", msg);
|
||||||
}
|
}
|
||||||
Message::FileTypo(msg) => print_long_correction(msg),
|
Message::Typo(msg) => print_long_correction(msg),
|
||||||
Message::PathTypo(msg) => match &msg.corrections {
|
|
||||||
crate::Status::Valid => {}
|
|
||||||
crate::Status::Invalid => {
|
|
||||||
println!(
|
|
||||||
"{}: error: `{}` is disallowed",
|
|
||||||
msg.path.display(),
|
|
||||||
msg.typo,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
crate::Status::Corrections(corrections) => {
|
|
||||||
println!(
|
|
||||||
"{}: error: `{}` should be {}",
|
|
||||||
msg.path.display(),
|
|
||||||
msg.typo,
|
|
||||||
itertools::join(corrections.iter().map(|c| format!("`{}`", c)), ", ")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Message::File(msg) => {
|
Message::File(msg) => {
|
||||||
println!("{}", msg.path.display());
|
println!("{}", msg.path.display());
|
||||||
}
|
}
|
||||||
|
@ -293,45 +270,66 @@ impl Report for PrintLong {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_long_correction(msg: &FileTypo) {
|
fn print_brief_correction(msg: &Typo) {
|
||||||
let line_num = msg.line_num.to_string();
|
match &msg.corrections {
|
||||||
let line_indent: String = itertools::repeat_n(" ", line_num.len()).collect();
|
crate::Status::Valid => {}
|
||||||
|
crate::Status::Invalid => {
|
||||||
let hl_indent: String = itertools::repeat_n(" ", msg.byte_offset).collect();
|
println!(
|
||||||
let hl: String = itertools::repeat_n("^", msg.typo.len()).collect();
|
"{}:{}: {} is disallowed",
|
||||||
|
msg.context, msg.byte_offset, msg.typo,
|
||||||
let line = String::from_utf8_lossy(msg.line);
|
);
|
||||||
let line = line.replace("\t", " ");
|
}
|
||||||
|
crate::Status::Corrections(corrections) => {
|
||||||
|
println!(
|
||||||
|
"{}:{}: {} -> {}",
|
||||||
|
msg.context,
|
||||||
|
msg.byte_offset,
|
||||||
|
msg.typo,
|
||||||
|
itertools::join(corrections.iter(), ", ")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn print_long_correction(msg: &Typo) {
|
||||||
let stdout = io::stdout();
|
let stdout = io::stdout();
|
||||||
let mut handle = stdout.lock();
|
let mut handle = stdout.lock();
|
||||||
match &msg.corrections {
|
match &msg.corrections {
|
||||||
crate::Status::Valid => {}
|
crate::Status::Valid => {}
|
||||||
crate::Status::Invalid => {
|
crate::Status::Invalid => {
|
||||||
writeln!(handle, "error: `{}` is disallowed", msg.typo,).unwrap();
|
writeln!(
|
||||||
|
handle,
|
||||||
|
"{}:{}: {} is disallowed",
|
||||||
|
msg.context, msg.byte_offset, msg.typo,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
crate::Status::Corrections(corrections) => {
|
crate::Status::Corrections(corrections) => {
|
||||||
writeln!(
|
writeln!(
|
||||||
handle,
|
handle,
|
||||||
"error: `{}` should be {}",
|
"error: `{}` should be {}",
|
||||||
msg.typo,
|
msg.typo,
|
||||||
itertools::join(corrections.iter().map(|c| format!("`{}`", c)), ", ")
|
itertools::join(corrections.iter(), ", ")
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writeln!(
|
writeln!(handle, " --> {}:{}", msg.context, msg.byte_offset).unwrap();
|
||||||
handle,
|
|
||||||
" --> {}:{}:{}",
|
if let Context::File(context) = &msg.context {
|
||||||
msg.path.display(),
|
let line_num = context.line_num.to_string();
|
||||||
msg.line_num,
|
let line_indent: String = itertools::repeat_n(" ", line_num.len()).collect();
|
||||||
msg.byte_offset
|
|
||||||
)
|
let hl_indent: String = itertools::repeat_n(" ", msg.byte_offset).collect();
|
||||||
.unwrap();
|
let hl: String = itertools::repeat_n("^", msg.typo.len()).collect();
|
||||||
writeln!(handle, "{} |", line_indent).unwrap();
|
|
||||||
writeln!(handle, "{} | {}", msg.line_num, line.trim_end()).unwrap();
|
let line = String::from_utf8_lossy(msg.buffer.as_ref());
|
||||||
writeln!(handle, "{} | {}{}", line_indent, hl_indent, hl).unwrap();
|
let line = line.replace("\t", " ");
|
||||||
writeln!(handle, "{} |", line_indent).unwrap();
|
writeln!(handle, "{} |", line_indent).unwrap();
|
||||||
|
writeln!(handle, "{} | {}", line_num, line.trim_end()).unwrap();
|
||||||
|
writeln!(handle, "{} | {}{}", line_indent, hl_indent, hl).unwrap();
|
||||||
|
writeln!(handle, "{} |", line_indent).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
|
|
@ -56,37 +56,41 @@ impl<'r> Replace<'r> {
|
||||||
|
|
||||||
impl<'r> typos::report::Report for Replace<'r> {
|
impl<'r> typos::report::Report for Replace<'r> {
|
||||||
fn report(&self, msg: typos::report::Message<'_>) -> bool {
|
fn report(&self, msg: typos::report::Message<'_>) -> bool {
|
||||||
match msg {
|
let typo = match &msg {
|
||||||
typos::report::Message::FileTypo(msg) => match msg.corrections {
|
typos::report::Message::Typo(typo) => typo,
|
||||||
typos::Status::Corrections(corrections) if corrections.len() == 1 => {
|
_ => return self.reporter.report(msg),
|
||||||
let path = msg.path.to_owned();
|
};
|
||||||
let line_num = msg.line_num;
|
|
||||||
let correction =
|
let corrections = match &typo.corrections {
|
||||||
Correction::new(msg.byte_offset, msg.typo, corrections[0].as_ref());
|
typos::Status::Corrections(corrections) if corrections.len() == 1 => corrections,
|
||||||
let mut deferred = self.deferred.lock().unwrap();
|
_ => return self.reporter.report(msg),
|
||||||
let content = deferred
|
};
|
||||||
.content
|
|
||||||
.entry(path)
|
match &typo.context {
|
||||||
.or_insert_with(BTreeMap::new)
|
typos::report::Context::File(file) => {
|
||||||
.entry(line_num)
|
let path = file.path.to_owned();
|
||||||
.or_insert_with(Vec::new);
|
let line_num = file.line_num;
|
||||||
content.push(correction);
|
let correction =
|
||||||
false
|
Correction::new(typo.byte_offset, typo.typo, corrections[0].as_ref());
|
||||||
}
|
let mut deferred = self.deferred.lock().unwrap();
|
||||||
_ => self.reporter.report(typos::report::Message::FileTypo(msg)),
|
let content = deferred
|
||||||
},
|
.content
|
||||||
typos::report::Message::PathTypo(msg) => match msg.corrections {
|
.entry(path)
|
||||||
typos::Status::Corrections(corrections) if corrections.len() == 1 => {
|
.or_insert_with(BTreeMap::new)
|
||||||
let path = msg.path.to_owned();
|
.entry(line_num)
|
||||||
let correction =
|
.or_insert_with(Vec::new);
|
||||||
Correction::new(msg.byte_offset, msg.typo, corrections[0].as_ref());
|
content.push(correction);
|
||||||
let mut deferred = self.deferred.lock().unwrap();
|
false
|
||||||
let content = deferred.paths.entry(path).or_insert_with(Vec::new);
|
}
|
||||||
content.push(correction);
|
typos::report::Context::Path(path) => {
|
||||||
false
|
let path = path.path.to_owned();
|
||||||
}
|
let correction =
|
||||||
_ => self.reporter.report(typos::report::Message::PathTypo(msg)),
|
Correction::new(typo.byte_offset, typo.typo, corrections[0].as_ref());
|
||||||
},
|
let mut deferred = self.deferred.lock().unwrap();
|
||||||
|
let content = deferred.paths.entry(path).or_insert_with(Vec::new);
|
||||||
|
content.push(correction);
|
||||||
|
false
|
||||||
|
}
|
||||||
_ => self.reporter.report(msg),
|
_ => self.reporter.report(msg),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,10 +208,14 @@ mod test {
|
||||||
let primary = typos::report::PrintSilent;
|
let primary = typos::report::PrintSilent;
|
||||||
let replace = Replace::new(&primary);
|
let replace = Replace::new(&primary);
|
||||||
replace.report(
|
replace.report(
|
||||||
typos::report::FileTypo::default()
|
typos::report::Typo::default()
|
||||||
.path(input_file.path())
|
.context(
|
||||||
.line(b"1 foo 2\n3 4 5")
|
typos::report::FileContext::default()
|
||||||
.line_num(1)
|
.path(input_file.path())
|
||||||
|
.line_num(1)
|
||||||
|
.into(),
|
||||||
|
)
|
||||||
|
.buffer(std::borrow::Cow::Borrowed(b"1 foo 2\n3 4 5"))
|
||||||
.byte_offset(2)
|
.byte_offset(2)
|
||||||
.typo("foo")
|
.typo("foo")
|
||||||
.corrections(typos::Status::Corrections(vec![
|
.corrections(typos::Status::Corrections(vec![
|
||||||
|
@ -229,8 +237,13 @@ mod test {
|
||||||
let primary = typos::report::PrintSilent;
|
let primary = typos::report::PrintSilent;
|
||||||
let replace = Replace::new(&primary);
|
let replace = Replace::new(&primary);
|
||||||
replace.report(
|
replace.report(
|
||||||
typos::report::PathTypo::default()
|
typos::report::Typo::default()
|
||||||
.path(input_file.path())
|
.context(
|
||||||
|
typos::report::PathContext::default()
|
||||||
|
.path(input_file.path())
|
||||||
|
.into(),
|
||||||
|
)
|
||||||
|
.buffer(std::borrow::Cow::Borrowed(b"foo.txt"))
|
||||||
.byte_offset(0)
|
.byte_offset(0)
|
||||||
.typo("foo")
|
.typo("foo")
|
||||||
.corrections(typos::Status::Corrections(vec![
|
.corrections(typos::Status::Corrections(vec![
|
||||||
|
|
Loading…
Add table
Reference in a new issue