Skip to content

Commit

Permalink
Fix cargo clippy warning and error (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtczza committed May 3, 2024
1 parent 39ef1e4 commit 2545954
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/macros.rs
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
Expand Up @@ -244,20 +244,20 @@ impl serde::ser::Serialize for Color {
_ => "",
};

Check failure on line 246 in src/style/types/color.rs

View workflow job for this annotation

GitHub Actions / stable on ubuntu-latest

Diff in /home/runner/work/crossterm/crossterm/src/style/types/color.rs

Check failure on line 246 in src/style/types/color.rs

View workflow job for this annotation

GitHub Actions / stable on macOS-latest

Diff in /Users/runner/work/crossterm/crossterm/src/style/types/color.rs
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))
}
_ => {

Check failure on line 255 in src/style/types/color.rs

View workflow job for this annotation

GitHub Actions / stable on ubuntu-latest

Diff in /home/runner/work/crossterm/crossterm/src/style/types/color.rs

Check failure on line 255 in src/style/types/color.rs

View workflow job for this annotation

GitHub Actions / stable on macOS-latest

Diff in /Users/runner/work/crossterm/crossterm/src/style/types/color.rs
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

0 comments on commit 2545954

Please sign in to comment.