Fix clippy lints for Rust 1.66
This commit is contained in:
parent
e0c728c62c
commit
6bb01b7276
10 changed files with 28 additions and 40 deletions
|
|
@ -881,8 +881,7 @@ impl State {
|
|||
|
||||
self.offset = Offset::Absolute(
|
||||
(self.offset.absolute(bounds, content_bounds) - delta_y)
|
||||
.max(0.0)
|
||||
.min((content_bounds.height - bounds.height) as f32),
|
||||
.clamp(0.0, content_bounds.height - bounds.height),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -905,7 +904,7 @@ impl State {
|
|||
/// `0` represents scrollbar at the top, while `1` represents scrollbar at
|
||||
/// the bottom.
|
||||
pub fn snap_to(&mut self, percentage: f32) {
|
||||
self.offset = Offset::Relative(percentage.max(0.0).min(1.0));
|
||||
self.offset = Offset::Relative(percentage.clamp(0.0, 1.0));
|
||||
}
|
||||
|
||||
/// Unsnaps the current scroll position, if snapped, given the bounds of the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue