One big cleanup pass of clippy lints

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
ForLoveOfCats
2022-08-10 16:51:01 -07:00
committed by K Simmons
co-authored by Mikayla
parent e7540d2833
commit 8ba2f77148
138 changed files with 1328 additions and 1366 deletions
+11 -12
View File
@@ -45,6 +45,7 @@ pub struct LayoutState {
pub struct UniformList {
state: UniformListState,
item_count: usize,
#[allow(clippy::type_complexity)]
append_items: Box<dyn Fn(Range<usize>, &mut Vec<ElementBox>, &mut LayoutContext)>,
padding_top: f32,
padding_bottom: f32,
@@ -310,19 +311,17 @@ impl Element for UniformList {
handled = item.dispatch_event(event, cx) || handled;
}
match event {
Event::ScrollWheel(ScrollWheelEvent {
position,
delta,
precise,
}) => {
if bounds.contains_point(*position) {
if self.scroll(*position, *delta, *precise, layout.scroll_max, cx) {
handled = true;
}
}
if let Event::ScrollWheel(ScrollWheelEvent {
position,
delta,
precise,
}) = event
{
if bounds.contains_point(*position)
&& self.scroll(*position, *delta, *precise, layout.scroll_max, cx)
{
handled = true;
}
_ => {}
}
handled