Skip to content

Commit 2545954

Browse files
authored
Fix cargo clippy warning and error (#877)
1 parent 39ef1e4 commit 2545954

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ mod tests {
149149

150150
// Helper for execute tests to confirm flush
151151
#[derive(Default, Debug, Clone)]
152-
pub(self) struct FakeWrite {
152+
struct FakeWrite {
153153
buffer: String,
154154
flushed: bool,
155155
}

Diff for: src/style/types/color.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,20 @@ impl serde::ser::Serialize for Color {
244244
_ => "",
245245
};
246246

247-
if str == "" {
247+
if str.is_empty() {
248248
match *self {
249249
Color::AnsiValue(value) => {
250-
return serializer.serialize_str(&format!("ansi_({})", value));
250+
serializer.serialize_str(&format!("ansi_({})", value))
251251
}
252252
Color::Rgb { r, g, b } => {
253-
return serializer.serialize_str(&format!("rgb_({},{},{})", r, g, b));
253+
serializer.serialize_str(&format!("rgb_({},{},{})", r, g, b))
254254
}
255255
_ => {
256-
return Err(serde::ser::Error::custom("Could not serialize enum type"));
256+
Err(serde::ser::Error::custom("Could not serialize enum type"))
257257
}
258258
}
259259
} else {
260-
return serializer.serialize_str(str);
260+
serializer.serialize_str(str)
261261
}
262262
}
263263
}

0 commit comments

Comments
 (0)