Fix clippy::filter_map_next
This commit is contained in:
parent
14ba939e67
commit
1019d1e518
2 changed files with 15 additions and 15 deletions
|
|
@ -606,11 +606,10 @@ pub fn update<'a, Message, T: Draggable>(
|
|||
} else {
|
||||
let dropped_region = contents
|
||||
.zip(layout.children())
|
||||
.filter_map(|(target, layout)| {
|
||||
.find_map(|(target, layout)| {
|
||||
layout_region(layout, cursor_position)
|
||||
.map(|region| (target, region))
|
||||
})
|
||||
.next();
|
||||
});
|
||||
|
||||
match dropped_region {
|
||||
Some(((target, _), region))
|
||||
|
|
@ -1151,21 +1150,19 @@ pub struct ResizeEvent {
|
|||
* Helpers
|
||||
*/
|
||||
fn hovered_split<'a>(
|
||||
splits: impl Iterator<Item = (&'a Split, &'a (Axis, Rectangle, f32))>,
|
||||
mut splits: impl Iterator<Item = (&'a Split, &'a (Axis, Rectangle, f32))>,
|
||||
spacing: f32,
|
||||
cursor_position: Point,
|
||||
) -> Option<(Split, Axis, Rectangle)> {
|
||||
splits
|
||||
.filter_map(|(split, (axis, region, ratio))| {
|
||||
let bounds = axis.split_line_bounds(*region, *ratio, spacing);
|
||||
splits.find_map(|(split, (axis, region, ratio))| {
|
||||
let bounds = axis.split_line_bounds(*region, *ratio, spacing);
|
||||
|
||||
if bounds.contains(cursor_position) {
|
||||
Some((*split, *axis, bounds))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.next()
|
||||
if bounds.contains(cursor_position) {
|
||||
Some((*split, *axis, bounds))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// The visible contents of the [`PaneGrid`]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue