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

fix cargo clippy warning and error #877

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
10 changes: 5 additions & 5 deletions src/style/types/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down