Skip to content

Commit

Permalink
refactor(report): Leverage derive_more, more
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 7, 2019
1 parent e90a89e commit f15191d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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!(
Expand All @@ -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) => {
Expand Down

0 comments on commit f15191d

Please sign in to comment.