Skip to content

Commit

Permalink
lint rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Mar 19, 2024
1 parent f1567f3 commit 9587b30
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/format_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ pub fn format_labels(array: Vec<IssueLabelDetail>) -> Result<MatrixMessageFormat
write!(html, " data-mx-bg-color=\"#{}\"", color).unwrap();
// Determine the constrast
let color_rgb = parse_rgb(color)?;
let contrast_color =
if contrast::<u8, f32>(color_rgb, RGB::new(0, 0, 0)) > 4.5 {
"#000000"
} else {
"#FFFFFF"
};
let contrast_color = if contrast::<u8, f32>(color_rgb, RGB::new(0, 0, 0)) > 4.5 {
"#000000"
} else {
"#FFFFFF"
};
write!(html, " data-mx-color=\"{}\"", contrast_color).unwrap();
}
if let Some(description) = label.description {
Expand Down

0 comments on commit 9587b30

Please sign in to comment.