mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-22 15:42:23 -05:00
refactor(report): Leverage derive_more, more
This commit is contained in:
parent
e90a89ef93
commit
f15191de14
1 changed files with 4 additions and 3 deletions
|
@ -10,7 +10,8 @@ pub enum Message<'m> {
|
|||
FilenameCorrection(FilenameCorrection<'m>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize)]
|
||||
#[derive(Clone, Debug, serde::Serialize, derive_more::Display)]
|
||||
#[display(fmt = "Skipping binary file {}", "path.display()")]
|
||||
pub struct BinaryFile<'m> {
|
||||
pub path: &'m std::path::Path,
|
||||
#[serde(skip)]
|
||||
|
@ -46,7 +47,7 @@ pub fn print_silent(_: Message) {}
|
|||
pub fn print_brief(msg: Message) {
|
||||
match msg {
|
||||
Message::BinaryFile(msg) => {
|
||||
println!("Skipping binary file {}", msg.path.display(),);
|
||||
println!("{}", msg);
|
||||
}
|
||||
Message::Correction(msg) => {
|
||||
println!(
|
||||
|
@ -67,7 +68,7 @@ pub fn print_brief(msg: Message) {
|
|||
pub fn print_long(msg: Message) {
|
||||
match msg {
|
||||
Message::BinaryFile(msg) => {
|
||||
println!("Skipping binary file {}", msg.path.display(),);
|
||||
println!("{}", msg);
|
||||
}
|
||||
Message::Correction(msg) => print_long_correction(msg),
|
||||
Message::FilenameCorrection(msg) => {
|
||||
|
|
Loading…
Reference in a new issue