Skip to content

Commit

Permalink
Address clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mina86 committed Jan 31, 2024
1 parent 28fffaa commit 3f56b28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ impl<'a, T: AsRGB + ?Sized> AsRGB for &'a T {
}

#[cfg(feature = "rgb")]
trait Component {
fn into_u8(&self) -> u8;
trait Component: Copy {
fn into_u8(self) -> u8;
}
#[cfg(feature = "rgb")]
impl Component for u8 {
#[inline(always)]
fn into_u8(&self) -> u8 { *self }
fn into_u8(self) -> u8 { self }
}
#[cfg(feature = "rgb")]
impl Component for u16 {
#[inline(always)]
fn into_u8(&self) -> u8 { (*self >> 8) as u8 }
fn into_u8(self) -> u8 { (self >> 8) as u8 }
}

#[cfg(feature = "rgb")]
Expand Down

0 comments on commit 3f56b28

Please sign in to comment.