Skip to content

Commit

Permalink
style: fix cargo formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka committed May 5, 2024
1 parent 6d20946 commit fdc036e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/style/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ mod tests {

#[test]
fn test_attributes_const() {
const ATTRIBUTES: Attributes = Attributes::none().with(Attribute::Bold).with(Attribute::Italic).without(Attribute::Bold);
assert!(!ATTRIBUTES.has(Attribute::Bold));
assert!(ATTRIBUTES.has(Attribute::Italic));
const ATTRIBUTES: Attributes = Attributes::none()
.with(Attribute::Bold)
.with(Attribute::Italic)
.without(Attribute::Bold);
assert!(!ATTRIBUTES.has(Attribute::Bold));
assert!(ATTRIBUTES.has(Attribute::Italic));
}
}
8 changes: 2 additions & 6 deletions src/style/types/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,11 @@ impl serde::ser::Serialize for Color {

if str.is_empty() {
match *self {
Color::AnsiValue(value) => {
serializer.serialize_str(&format!("ansi_({})", value))
}
Color::AnsiValue(value) => serializer.serialize_str(&format!("ansi_({})", value)),
Color::Rgb { r, g, b } => {
serializer.serialize_str(&format!("rgb_({},{},{})", r, g, b))
}
_ => {
Err(serde::ser::Error::custom("Could not serialize enum type"))
}
_ => Err(serde::ser::Error::custom("Could not serialize enum type")),
}
} else {
serializer.serialize_str(str)
Expand Down

0 comments on commit fdc036e

Please sign in to comment.