Skip to content

Commit

Permalink
refactor(lint): fix new lint warnings (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Jun 14, 2024
1 parent d370aa7 commit 7d175f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/demo/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ pub struct TabsState<'a> {
}

impl<'a> TabsState<'a> {
pub fn new(titles: Vec<&'a str>) -> TabsState {
TabsState { titles, index: 0 }
pub fn new(titles: Vec<&'a str>) -> Self {
Self { titles, index: 0 }
}
pub fn next(&mut self) {
self.index = (self.index + 1) % self.titles.len();
Expand Down
2 changes: 1 addition & 1 deletion src/layout/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Rect {
/// Creates a new `Rect`, with width and height limited to keep the area under max `u16`. If
/// clipped, aspect ratio will be preserved.
pub fn new(x: u16, y: u16, width: u16, height: u16) -> Self {
let max_area = u16::max_value();
let max_area = u16::MAX;
let (clipped_width, clipped_height) =
if u32::from(width) * u32::from(height) > u32::from(max_area) {
let aspect_ratio = f64::from(width) / f64::from(height);
Expand Down
4 changes: 2 additions & 2 deletions src/style/palette_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use super::Color;
impl<T: IntoStimulus<u8>> From<Srgb<T>> for Color {
fn from(color: Srgb<T>) -> Self {
let (red, green, blue) = color.into_format().into_components();
Color::Rgb(red, green, blue)
Self::Rgb(red, green, blue)
}
}

Expand All @@ -48,7 +48,7 @@ where
{
fn from(color: LinSrgb<T>) -> Self {
let srgb_color = Srgb::<T>::from_linear(color);
Color::from(srgb_color)
Self::from(srgb_color)
}
}

Expand Down

0 comments on commit 7d175f8

Please sign in to comment.