mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-04-08 17:05:59 +02:00
refactor: fix clippy errors
This commit is contained in:
parent
15dba2e6cf
commit
78e3c37947
src
@ -323,13 +323,15 @@ impl BottomLayout {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let mut up_range = layout_mapping.range(
|
||||
..(
|
||||
row_height_percentage_start,
|
||||
row_height_percentage_start,
|
||||
),
|
||||
);
|
||||
while let Some(next_row_up) = up_range.next_back() {
|
||||
for next_row_up in layout_mapping
|
||||
.range(
|
||||
..(
|
||||
row_height_percentage_start,
|
||||
row_height_percentage_start,
|
||||
),
|
||||
)
|
||||
.rev()
|
||||
{
|
||||
let mut current_best_distance = 0;
|
||||
let mut current_best_widget_id = widget.widget_id;
|
||||
let (target_start_width, target_end_width) =
|
||||
@ -439,13 +441,12 @@ impl BottomLayout {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let mut down_range = layout_mapping.range(
|
||||
for next_row_down in layout_mapping.range(
|
||||
(
|
||||
row_height_percentage_start + 1,
|
||||
row_height_percentage_start + 1,
|
||||
)..,
|
||||
);
|
||||
while let Some(next_row_down) = down_range.next() {
|
||||
) {
|
||||
let mut current_best_distance = 0;
|
||||
let mut current_best_widget_id = widget.widget_id;
|
||||
let (target_start_width, target_end_width) =
|
||||
|
@ -28,14 +28,12 @@ impl BasicTableArrows for Painter {
|
||||
app_state
|
||||
.current_widget
|
||||
.left_neighbour
|
||||
.and_then(|left_widget_id| {
|
||||
Some(
|
||||
app_state
|
||||
.widget_map
|
||||
.get(&left_widget_id)
|
||||
.and_then(|left_widget| Some(&left_widget.widget_type))
|
||||
.unwrap_or_else(|| &BottomWidgetType::Temp),
|
||||
)
|
||||
.map(|left_widget_id| {
|
||||
app_state
|
||||
.widget_map
|
||||
.get(&left_widget_id)
|
||||
.map(|left_widget| &left_widget.widget_type)
|
||||
.unwrap_or_else(|| &BottomWidgetType::Temp)
|
||||
})
|
||||
.unwrap_or_else(|| &BottomWidgetType::Temp)
|
||||
},
|
||||
@ -43,14 +41,12 @@ impl BasicTableArrows for Painter {
|
||||
app_state
|
||||
.current_widget
|
||||
.right_neighbour
|
||||
.and_then(|right_widget_id| {
|
||||
Some(
|
||||
app_state
|
||||
.widget_map
|
||||
.get(&right_widget_id)
|
||||
.and_then(|right_widget| Some(&right_widget.widget_type))
|
||||
.unwrap_or_else(|| &BottomWidgetType::Disk),
|
||||
)
|
||||
.map(|right_widget_id| {
|
||||
app_state
|
||||
.widget_map
|
||||
.get(&right_widget_id)
|
||||
.map(|right_widget| &right_widget.widget_type)
|
||||
.unwrap_or_else(|| &BottomWidgetType::Disk)
|
||||
})
|
||||
.unwrap_or_else(|| &BottomWidgetType::Disk)
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user