Fix cargo clippy warning and error (#877)
This commit is contained in:
parent
39ef1e42ba
commit
2545954076
@ -149,7 +149,7 @@ mod tests {
|
||||
|
||||
// Helper for execute tests to confirm flush
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub(self) struct FakeWrite {
|
||||
struct FakeWrite {
|
||||
buffer: String,
|
||||
flushed: bool,
|
||||
}
|
||||
|
@ -244,20 +244,20 @@ impl serde::ser::Serialize for Color {
|
||||
_ => "",
|
||||
};
|
||||
|
||||
if str == "" {
|
||||
if str.is_empty() {
|
||||
match *self {
|
||||
Color::AnsiValue(value) => {
|
||||
return serializer.serialize_str(&format!("ansi_({})", value));
|
||||
serializer.serialize_str(&format!("ansi_({})", value))
|
||||
}
|
||||
Color::Rgb { r, g, b } => {
|
||||
return serializer.serialize_str(&format!("rgb_({},{},{})", r, g, b));
|
||||
serializer.serialize_str(&format!("rgb_({},{},{})", r, g, b))
|
||||
}
|
||||
_ => {
|
||||
return Err(serde::ser::Error::custom("Could not serialize enum type"));
|
||||
Err(serde::ser::Error::custom("Could not serialize enum type"))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return serializer.serialize_str(str);
|
||||
serializer.serialize_str(str)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user