clippy fixes
This commit is contained in:
parent
ad241c700a
commit
17bc373990
7 changed files with 16 additions and 16 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
use iced::{
|
use iced::{
|
||||||
event,
|
event,
|
||||||
keyboard::{self, KeyCode},
|
keyboard::{self, KeyCode},
|
||||||
mouse, subscription, Command, Event, Subscription,
|
mouse, Command, Event, Subscription,
|
||||||
};
|
};
|
||||||
use iced_core::{
|
use iced_core::{
|
||||||
widget::{operation, Id, Operation},
|
widget::{operation, Id, Operation},
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ impl<'a, Message> iced_core::Overlay<Message, crate::Renderer> for Overlay<'a, M
|
||||||
)
|
)
|
||||||
.width(self.width);
|
.width(self.width);
|
||||||
|
|
||||||
let mut node = self.container.layout(&mut self.state, renderer, &limits);
|
let mut node = self.container.layout(self.state, renderer, &limits);
|
||||||
|
|
||||||
node.move_to(if space_below > space_above {
|
node.move_to(if space_below > space_above {
|
||||||
position + Vector::new(0.0, self.target_height)
|
position + Vector::new(0.0, self.target_height)
|
||||||
|
|
|
||||||
|
|
@ -413,13 +413,13 @@ pub fn mouse_interaction(layout: Layout<'_>, cursor: mouse::Cursor) -> mouse::In
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn overlay<'a, S: AsRef<str>, Message: 'a>(
|
pub fn overlay<'a, S: AsRef<str>, Message: 'a>(
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
renderer: &crate::Renderer,
|
_renderer: &crate::Renderer,
|
||||||
state: &'a mut State,
|
state: &'a mut State,
|
||||||
gap: f32,
|
gap: f32,
|
||||||
padding: Padding,
|
padding: Padding,
|
||||||
text_size: f32,
|
text_size: f32,
|
||||||
text_line_height: text::LineHeight,
|
_text_line_height: text::LineHeight,
|
||||||
font: Option<crate::font::Font>,
|
_font: Option<crate::font::Font>,
|
||||||
selections: &'a [S],
|
selections: &'a [S],
|
||||||
selected_option: Option<usize>,
|
selected_option: Option<usize>,
|
||||||
on_selected: &'a dyn Fn(usize) -> Message,
|
on_selected: &'a dyn Fn(usize) -> Message,
|
||||||
|
|
@ -440,7 +440,7 @@ pub fn overlay<'a, S: AsRef<str>, Message: 'a>(
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
.width({
|
.width({
|
||||||
let measure = |label: &str, selection_paragraph: &mut crate::Paragraph| -> f32 {
|
let measure = |_label: &str, selection_paragraph: &mut crate::Paragraph| -> f32 {
|
||||||
selection_paragraph.min_width().round()
|
selection_paragraph.min_width().round()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ pub fn resolve<Message>(
|
||||||
|
|
||||||
let mut row_buffer = Vec::<Node>::with_capacity(8);
|
let mut row_buffer = Vec::<Node>::with_capacity(8);
|
||||||
|
|
||||||
for (child, tree) in items.iter().zip(tree.into_iter()) {
|
for (child, tree) in items.iter().zip(tree.iter_mut()) {
|
||||||
// Calculate the dimensions of the item.
|
// Calculate the dimensions of the item.
|
||||||
let child_node = child.as_widget().layout(tree, renderer, &limits);
|
let child_node = child.as_widget().layout(tree, renderer, &limits);
|
||||||
let size = child_node.size();
|
let size = child_node.size();
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ where
|
||||||
let active_tree = &mut tree_children[active_root];
|
let active_tree = &mut tree_children[active_root];
|
||||||
state.menu_states.iter().enumerate().fold(
|
state.menu_states.iter().enumerate().fold(
|
||||||
(root, Vec::new()),
|
(root, Vec::new()),
|
||||||
|(menu_root, mut nodes), (i, ms)| {
|
|(menu_root, mut nodes), (_i, ms)| {
|
||||||
let slice = ms.slice(bounds, overlay_offset, self.item_height);
|
let slice = ms.slice(bounds, overlay_offset, self.item_height);
|
||||||
let start_index = slice.start_index;
|
let start_index = slice.start_index;
|
||||||
let end_index = slice.end_index;
|
let end_index = slice.end_index;
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ where
|
||||||
&self,
|
&self,
|
||||||
state: &mut LocalState,
|
state: &mut LocalState,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
bounds: Size,
|
_bounds: Size,
|
||||||
) -> (f32, f32) {
|
) -> (f32, f32) {
|
||||||
let mut width = 0.0f32;
|
let mut width = 0.0f32;
|
||||||
let mut height = 0.0f32;
|
let mut height = 0.0f32;
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,6 @@ pub struct TextInput<'a, Message> {
|
||||||
leading_icon: Option<Element<'a, Message, crate::Renderer>>,
|
leading_icon: Option<Element<'a, Message, crate::Renderer>>,
|
||||||
trailing_icon: Option<Element<'a, Message, crate::Renderer>>,
|
trailing_icon: Option<Element<'a, Message, crate::Renderer>>,
|
||||||
style: <<crate::Renderer as iced_core::Renderer>::Theme as StyleSheet>::Style,
|
style: <<crate::Renderer as iced_core::Renderer>::Theme as StyleSheet>::Style,
|
||||||
// (text_input::State, mime_type, dnd_action) -> Message
|
|
||||||
on_create_dnd_source: Option<Box<dyn Fn(State) -> Message + 'a>>,
|
on_create_dnd_source: Option<Box<dyn Fn(State) -> Message + 'a>>,
|
||||||
on_dnd_command_produced: Option<Box<dyn Fn(DnDCommand) -> Message + 'a>>,
|
on_dnd_command_produced: Option<Box<dyn Fn(DnDCommand) -> Message + 'a>>,
|
||||||
surface_ids: Option<(window::Id, window::Id)>,
|
surface_ids: Option<(window::Id, window::Id)>,
|
||||||
|
|
@ -1074,10 +1073,10 @@ pub fn update<'a, Message>(
|
||||||
on_paste: Option<&dyn Fn(String) -> Message>,
|
on_paste: Option<&dyn Fn(String) -> Message>,
|
||||||
on_submit: &Option<Message>,
|
on_submit: &Option<Message>,
|
||||||
state: impl FnOnce() -> &'a mut State,
|
state: impl FnOnce() -> &'a mut State,
|
||||||
on_start_dnd_source: Option<&dyn Fn(State) -> Message>,
|
#[allow(unused_variables)] on_start_dnd_source: Option<&dyn Fn(State) -> Message>,
|
||||||
_dnd_icon: bool,
|
#[allow(unused_variables)] dnd_icon: bool,
|
||||||
on_dnd_command_produced: Option<&dyn Fn(DnDCommand) -> Message>,
|
#[allow(unused_variables)] on_dnd_command_produced: Option<&dyn Fn(DnDCommand) -> Message>,
|
||||||
surface_ids: Option<(window::Id, window::Id)>,
|
#[allow(unused_variables)] surface_ids: Option<(window::Id, window::Id)>,
|
||||||
line_height: text::LineHeight,
|
line_height: text::LineHeight,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
) -> event::Status
|
) -> event::Status
|
||||||
|
|
@ -1203,7 +1202,7 @@ where
|
||||||
find_cursor_position(
|
find_cursor_position(
|
||||||
text_layout.bounds(),
|
text_layout.bounds(),
|
||||||
&value,
|
&value,
|
||||||
&state,
|
state,
|
||||||
target,
|
target,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2156,6 +2155,7 @@ pub struct State {
|
||||||
pub label: crate::Paragraph,
|
pub label: crate::Paragraph,
|
||||||
is_focused: Option<Focus>,
|
is_focused: Option<Focus>,
|
||||||
dragging_state: Option<DraggingState>,
|
dragging_state: Option<DraggingState>,
|
||||||
|
#[cfg(feature = "wayland")]
|
||||||
dnd_offer: DndOfferState,
|
dnd_offer: DndOfferState,
|
||||||
is_pasting: Option<Value>,
|
is_pasting: Option<Value>,
|
||||||
last_click: Option<mouse::Click>,
|
last_click: Option<mouse::Click>,
|
||||||
|
|
@ -2209,7 +2209,7 @@ impl State {
|
||||||
|
|
||||||
is_focused: None,
|
is_focused: None,
|
||||||
dragging_state: None,
|
dragging_state: None,
|
||||||
#[allow(clippy::default_constructed_unit_structs)]
|
#[cfg(feature = "wayland")]
|
||||||
dnd_offer: DndOfferState::default(),
|
dnd_offer: DndOfferState::default(),
|
||||||
is_pasting: None,
|
is_pasting: None,
|
||||||
last_click: None,
|
last_click: None,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue