Fix lints for Rust 1.89 and bump MSRV to 1.88

This commit is contained in:
Héctor Ramón Jiménez 2025-08-07 22:36:02 +02:00
parent 88185f9d97
commit d5cd0a6de9
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
21 changed files with 360 additions and 395 deletions

View file

@ -599,17 +599,16 @@ where
if is_focused {
self.state.with_inner(|state| {
if !started_focused {
if let Some(on_option_hovered) = &mut self.on_option_hovered
{
let hovered_option = menu.hovered_option.unwrap_or(0);
if !started_focused
&& let Some(on_option_hovered) = &mut self.on_option_hovered
{
let hovered_option = menu.hovered_option.unwrap_or(0);
if let Some(option) =
state.filtered_options.options.get(hovered_option)
{
shell.publish(on_option_hovered(option.clone()));
published_message_to_shell = true;
}
if let Some(option) =
state.filtered_options.options.get(hovered_option)
{
shell.publish(on_option_hovered(option.clone()));
published_message_to_shell = true;
}
}
@ -622,12 +621,11 @@ where
let shift_modifier = modifiers.shift();
match (named_key, shift_modifier) {
(key::Named::Enter, _) => {
if let Some(index) = &menu.hovered_option {
if let Some(option) =
if let Some(index) = &menu.hovered_option
&& let Some(option) =
state.filtered_options.options.get(*index)
{
menu.new_selection = Some(option.clone());
}
{
menu.new_selection = Some(option.clone());
}
shell.capture_event();
@ -650,21 +648,19 @@ where
if let Some(on_option_hovered) =
&mut self.on_option_hovered
{
if let Some(option) =
&& let Some(option) =
menu.hovered_option.and_then(|index| {
state
.filtered_options
.options
.get(index)
})
{
// Notify the selection
shell.publish((on_option_hovered)(
option.clone(),
));
published_message_to_shell = true;
}
{
// Notify the selection
shell.publish((on_option_hovered)(
option.clone(),
));
published_message_to_shell = true;
}
shell.capture_event();
@ -698,21 +694,19 @@ where
if let Some(on_option_hovered) =
&mut self.on_option_hovered
{
if let Some(option) =
&& let Some(option) =
menu.hovered_option.and_then(|index| {
state
.filtered_options
.options
.get(index)
})
{
// Notify the selection
shell.publish((on_option_hovered)(
option.clone(),
));
published_message_to_shell = true;
}
{
// Notify the selection
shell.publish((on_option_hovered)(
option.clone(),
));
published_message_to_shell = true;
}
shell.capture_event();