summaryrefslogtreecommitdiffstats
path: root/widget/src/scrollable.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-20 15:52:41 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-20 15:52:41 +0200
commit2f7ff1471d1f6119c769c77fa138a63e95b5d881 (patch)
tree83f20609fa20d534ef8bd32b3851cae03cbadbb2 /widget/src/scrollable.rs
parente8b01eb5435500c4b4d3135dde3d9e5910aca89e (diff)
parent33d780f691829ecd32f3a218008fcb40e005deb4 (diff)
downloadiced-2f7ff1471d1f6119c769c77fa138a63e95b5d881.tar.gz
iced-2f7ff1471d1f6119c769c77fa138a63e95b5d881.tar.bz2
iced-2f7ff1471d1f6119c769c77fa138a63e95b5d881.zip
Merge pull request #2096 from iced-rs/fix/some-more-lints
Fix some `clippy::pedantic` lints
Diffstat (limited to 'widget/src/scrollable.rs')
-rw-r--r--widget/src/scrollable.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs
index f92e6223..49aed2f0 100644
--- a/widget/src/scrollable.rs
+++ b/widget/src/scrollable.rs
@@ -46,7 +46,7 @@ where
id: None,
width: Length::Shrink,
height: Length::Shrink,
- direction: Default::default(),
+ direction: Direction::default(),
content: content.into(),
on_scroll: None,
style: Default::default(),
@@ -117,7 +117,7 @@ impl Direction {
match self {
Self::Horizontal(properties) => Some(properties),
Self::Both { horizontal, .. } => Some(horizontal),
- _ => None,
+ Self::Vertical(_) => None,
}
}
@@ -126,7 +126,7 @@ impl Direction {
match self {
Self::Vertical(properties) => Some(properties),
Self::Both { vertical, .. } => Some(vertical),
- _ => None,
+ Self::Horizontal(_) => None,
}
}
}
@@ -217,7 +217,7 @@ where
}
fn diff(&self, tree: &mut Tree) {
- tree.diff_children(std::slice::from_ref(&self.content))
+ tree.diff_children(std::slice::from_ref(&self.content));
}
fn width(&self) -> Length {
@@ -348,9 +348,9 @@ where
layout,
cursor,
viewport,
- )
+ );
},
- )
+ );
}
fn mouse_interaction(
@@ -1069,7 +1069,7 @@ impl operation::Scrollable for State {
}
fn scroll_to(&mut self, offset: AbsoluteOffset) {
- State::scroll_to(self, offset)
+ State::scroll_to(self, offset);
}
}
@@ -1203,7 +1203,7 @@ impl State {
(self.offset_y.absolute(bounds.height, content_bounds.height)
- delta.y)
.clamp(0.0, content_bounds.height - bounds.height),
- )
+ );
}
if bounds.width < content_bounds.width {