Fix clippy::filter_map_next
This commit is contained in:
parent
14ba939e67
commit
1019d1e518
2 changed files with 15 additions and 15 deletions
|
|
@ -7,6 +7,7 @@ clippy --workspace --no-deps -- \
|
|||
-D clippy::default_trait_access \
|
||||
-D clippy::match-wildcard-for-single-variants \
|
||||
-D clippy::redundant-closure-for-method-calls \
|
||||
-D clippy::filter_map_next
|
||||
"""
|
||||
|
||||
nitpick = """
|
||||
|
|
@ -35,5 +36,7 @@ clippy --workspace --no-deps -- \
|
|||
-A clippy::struct-excessive-bools \
|
||||
-A clippy::float-cmp \
|
||||
-A clippy::single_match_else \
|
||||
-A clippy::unreadable_literal
|
||||
-A clippy::unreadable_literal \
|
||||
-A clippy::explicit_deref_methods \
|
||||
-A clippy::map_unwrap_or
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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