Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix clippy warnings #165

Merged
merged 2 commits into from
Jul 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/fmt/writer/termcolor/extern_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ impl_styled_value_fmt!(
/// Hexadecimal numbers are written with a `0x` prefix.
#[allow(missing_docs)]
#[derive(Clone, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum Color {
Black,
Blue,
Expand All @@ -464,6 +463,8 @@ pub enum Color {
White,
Ansi256(u8),
Rgb(u8, u8, u8),
#[doc(hidden)]
__Nonexhaustive,
}

impl Color {
Expand All @@ -479,6 +480,7 @@ impl Color {
Color::White => Some(termcolor::Color::White),
Color::Ansi256(value) => Some(termcolor::Color::Ansi256(value)),
Color::Rgb(r, g, b) => Some(termcolor::Color::Rgb(r, g, b)),
_ => None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do bump the MSRV, let's also make this function return Color instead of Option<Color>.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, I totally missed that :)

}
}
}