Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiving committed Aug 18, 2024
1 parent bc1ed65 commit 28223fc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
20 changes: 16 additions & 4 deletions src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,26 @@ mod tests {

#[test]
fn test_argb_from_rgb_returns_correct_value_for_white() {
assert_eq!(Argb::from(Rgb::new(255, 255, 255)), Argb::from_u32(0xffffffff));
assert_eq!(Argb::from(Rgb::new(255, 255, 255)), Argb::from_u32(4294967295));
assert_eq!(
Argb::from(Rgb::new(255, 255, 255)),
Argb::from_u32(0xffffffff)
);
assert_eq!(
Argb::from(Rgb::new(255, 255, 255)),
Argb::from_u32(4294967295)
);
}

#[test]
fn test_argb_from_rgb_returns_correct_value_for_random_color() {
assert_eq!(Argb::from(Rgb::new(50, 150, 250)), Argb::from_u32(0xff3296fa));
assert_eq!(Argb::from(Rgb::new(50, 150, 250)), Argb::from_u32(4281505530));
assert_eq!(
Argb::from(Rgb::new(50, 150, 250)),
Argb::from_u32(0xff3296fa)
);
assert_eq!(
Argb::from(Rgb::new(50, 150, 250)),
Argb::from_u32(4281505530)
);
}

#[test]
Expand Down
5 changes: 4 additions & 1 deletion src/hct/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use crate::{color::{lstar_from_y, Argb}, utils::FromRef};
#[cfg(all(not(feature = "std"), feature = "libm"))]
#[allow(unused_imports)]
use crate::utils::no_std::FloatExt;
use crate::{
color::{lstar_from_y, Argb},
utils::FromRef,
};
use core::{
cmp::Ordering,
fmt,
Expand Down
2 changes: 1 addition & 1 deletion src/scheme/variant/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ impl SchemeContent {

#[cfg(test)]
mod tests {
use crate::color::Argb;
use super::SchemeContent;
use crate::color::Argb;

#[test]
fn test_key_colors() {
Expand Down
2 changes: 1 addition & 1 deletion src/scheme/variant/vibrant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ impl SchemeVibrant {

#[cfg(test)]
mod tests {
use crate::color::Argb;
use super::SchemeVibrant;
use crate::color::Argb;

#[test]
fn test_key_colors() {
Expand Down

0 comments on commit 28223fc

Please sign in to comment.