mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-02 07:21:24 +00:00
refactor(lints): add lints to scrollbar (#974)
This commit is contained in:
parent
e02f4768ce
commit
37b957c7e1
@ -13,6 +13,9 @@
|
||||
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
|
||||
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
|
||||
|
||||
#![warn(clippy::pedantic)]
|
||||
#![allow(clippy::wildcard_imports)]
|
||||
|
||||
use std::{
|
||||
error::Error,
|
||||
io,
|
||||
@ -107,6 +110,7 @@ fn run_app<B: Backend>(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_lines, clippy::cast_possible_truncation)]
|
||||
fn ui(f: &mut Frame, app: &mut App) {
|
||||
let size = f.size();
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
#![warn(clippy::pedantic)]
|
||||
#![allow(
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::cast_precision_loss,
|
||||
clippy::cast_sign_loss,
|
||||
clippy::module_name_repetitions,
|
||||
clippy::wildcard_imports
|
||||
)]
|
||||
|
||||
use std::iter;
|
||||
|
||||
use strum::{Display, EnumString};
|
||||
@ -523,7 +532,7 @@ impl Scrollbar<'_> {
|
||||
///
|
||||
/// This method returns the length of the start, thumb, and end as a tuple.
|
||||
fn part_lengths(&self, area: Rect, state: &ScrollbarState) -> (usize, usize, usize) {
|
||||
let track_length = self.track_length_excluding_arrow_heads(area) as f64;
|
||||
let track_length = f64::from(self.track_length_excluding_arrow_heads(area));
|
||||
let viewport_length = self.viewport_length(state, area) as f64;
|
||||
|
||||
// Ensure that the position of the thumb is within the bounds of the content taking into
|
||||
|
Loading…
x
Reference in New Issue
Block a user