Fix lints

This commit is contained in:
Jonas Platte 2021-02-25 21:26:00 +01:00
parent 67adcba945
commit 16d982ed97
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 14 additions and 14 deletions

View File

@ -17,7 +17,7 @@ use env_logger::filter::{Builder, Filter};
use log::{Log, Metadata, Record, SetLoggerError};
const FILTER_ENV: &'static str = "MY_LOG_LEVEL";
const FILTER_ENV: &str = "MY_LOG_LEVEL";
struct MyLogger {
inner: Filter,

View File

@ -255,7 +255,7 @@ impl Style {
/// });
/// ```
pub fn set_color(&mut self, color: Color) -> &mut Style {
self.spec.set_fg(color.into_termcolor());
self.spec.set_fg(Some(color.into_termcolor()));
self
}
@ -334,7 +334,7 @@ impl Style {
/// });
/// ```
pub fn set_bg(&mut self, color: Color) -> &mut Style {
self.spec.set_bg(color.into_termcolor());
self.spec.set_bg(Some(color.into_termcolor()));
self
}
@ -467,18 +467,18 @@ pub enum Color {
}
impl Color {
fn into_termcolor(self) -> Option<termcolor::Color> {
fn into_termcolor(self) -> termcolor::Color {
match self {
Color::Black => Some(termcolor::Color::Black),
Color::Blue => Some(termcolor::Color::Blue),
Color::Green => Some(termcolor::Color::Green),
Color::Red => Some(termcolor::Color::Red),
Color::Cyan => Some(termcolor::Color::Cyan),
Color::Magenta => Some(termcolor::Color::Magenta),
Color::Yellow => Some(termcolor::Color::Yellow),
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)),
Color::Black => termcolor::Color::Black,
Color::Blue => termcolor::Color::Blue,
Color::Green => termcolor::Color::Green,
Color::Red => termcolor::Color::Red,
Color::Cyan => termcolor::Color::Cyan,
Color::Magenta => termcolor::Color::Magenta,
Color::Yellow => termcolor::Color::Yellow,
Color::White => termcolor::Color::White,
Color::Ansi256(value) => termcolor::Color::Ansi256(value),
Color::Rgb(r, g, b) => termcolor::Color::Rgb(r, g, b),
}
}
}