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::default_trait_access \
|
||||||
-D clippy::match-wildcard-for-single-variants \
|
-D clippy::match-wildcard-for-single-variants \
|
||||||
-D clippy::redundant-closure-for-method-calls \
|
-D clippy::redundant-closure-for-method-calls \
|
||||||
|
-D clippy::filter_map_next
|
||||||
"""
|
"""
|
||||||
|
|
||||||
nitpick = """
|
nitpick = """
|
||||||
|
|
@ -35,5 +36,7 @@ clippy --workspace --no-deps -- \
|
||||||
-A clippy::struct-excessive-bools \
|
-A clippy::struct-excessive-bools \
|
||||||
-A clippy::float-cmp \
|
-A clippy::float-cmp \
|
||||||
-A clippy::single_match_else \
|
-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 {
|
} else {
|
||||||
let dropped_region = contents
|
let dropped_region = contents
|
||||||
.zip(layout.children())
|
.zip(layout.children())
|
||||||
.filter_map(|(target, layout)| {
|
.find_map(|(target, layout)| {
|
||||||
layout_region(layout, cursor_position)
|
layout_region(layout, cursor_position)
|
||||||
.map(|region| (target, region))
|
.map(|region| (target, region))
|
||||||
})
|
});
|
||||||
.next();
|
|
||||||
|
|
||||||
match dropped_region {
|
match dropped_region {
|
||||||
Some(((target, _), region))
|
Some(((target, _), region))
|
||||||
|
|
@ -1151,21 +1150,19 @@ pub struct ResizeEvent {
|
||||||
* Helpers
|
* Helpers
|
||||||
*/
|
*/
|
||||||
fn hovered_split<'a>(
|
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,
|
spacing: f32,
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
) -> Option<(Split, Axis, Rectangle)> {
|
) -> Option<(Split, Axis, Rectangle)> {
|
||||||
splits
|
splits.find_map(|(split, (axis, region, ratio))| {
|
||||||
.filter_map(|(split, (axis, region, ratio))| {
|
let bounds = axis.split_line_bounds(*region, *ratio, spacing);
|
||||||
let bounds = axis.split_line_bounds(*region, *ratio, spacing);
|
|
||||||
|
|
||||||
if bounds.contains(cursor_position) {
|
if bounds.contains(cursor_position) {
|
||||||
Some((*split, *axis, bounds))
|
Some((*split, *axis, bounds))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.next()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The visible contents of the [`PaneGrid`]
|
/// The visible contents of the [`PaneGrid`]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue