Skip to content

Commit

Permalink
Merge pull request #50 from dtolnay-contrib/mascot
Browse files Browse the repository at this point in the history
Remove conditional compilation from mascot constants
  • Loading branch information
lcnr authored Mar 30, 2024
2 parents c314b5a + 6b7d31e commit 0e29bca
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@ use unicode_width::UnicodeWidthStr;
// Constants! :D
const ENDSL: &[u8] = b"| ";
const ENDSR: &[u8] = b" |\n";
#[cfg(not(feature = "clippy"))]
const FERRIS: &[u8] = br#"
\
\
_~^~^~_
\) / o o \ (/
'_ - _'
/ '-----' \
"#;

#[cfg(feature = "clippy")]
const CLIPPY: &[u8] = br#"
const MASCOT: &[u8] = if cfg!(feature = "clippy") {
br#"
\
\
__
Expand All @@ -29,7 +19,17 @@ const CLIPPY: &[u8] = br#"
|| ||
|\_/|
\___/
"#;
"#
} else {
br#"
\
\
_~^~^~_
\) / o o \ (/
'_ - _'
/ '-----' \
"#
};
const NEWLINE: u8 = b'\n';
const DASH: u8 = b'-';
const UNDERSCORE: u8 = b'_';
Expand Down Expand Up @@ -135,10 +135,7 @@ where
}

// mascot
#[cfg(feature = "clippy")]
write_buffer.extend_from_slice(CLIPPY);
#[cfg(not(feature = "clippy"))]
write_buffer.extend_from_slice(FERRIS);
write_buffer.extend_from_slice(MASCOT);

writer.write_all(&write_buffer)
}
Expand Down

0 comments on commit 0e29bca

Please sign in to comment.