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
|
// Helper for execute tests to confirm flush
|
||||||
#[derive(Default, Debug, Clone)]
|
#[derive(Default, Debug, Clone)]
|
||||||
pub(self) struct FakeWrite {
|
struct FakeWrite {
|
||||||
buffer: String,
|
buffer: String,
|
||||||
flushed: bool,
|
flushed: bool,
|
||||||
}
|
}
|
||||||
|
@ -244,20 +244,20 @@ impl serde::ser::Serialize for Color {
|
|||||||
_ => "",
|
_ => "",
|
||||||
};
|
};
|
||||||
|
|
||||||
if str == "" {
|
if str.is_empty() {
|
||||||
match *self {
|
match *self {
|
||||||
Color::AnsiValue(value) => {
|
Color::AnsiValue(value) => {
|
||||||
return serializer.serialize_str(&format!("ansi_({})", value));
|
serializer.serialize_str(&format!("ansi_({})", value))
|
||||||
}
|
}
|
||||||
Color::Rgb { r, g, b } => {
|
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 {
|
} else {
|
||||||
return serializer.serialize_str(str);
|
serializer.serialize_str(str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user