mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
refactor(lint): fix new lint warnings (#1178)
This commit is contained in:
parent
d370aa75af
commit
7d175f85c1
3 changed files with 5 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue