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::{
|
||||
event,
|
||||
keyboard::{self, KeyCode},
|
||||
mouse, subscription, Command, Event, Subscription,
|
||||
mouse, Command, Event, Subscription,
|
||||
};
|
||||
use iced_core::{
|
||||
widget::{operation, Id, Operation},
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ impl<'a, Message> iced_core::Overlay<Message, crate::Renderer> for Overlay<'a, M
|
|||
)
|
||||
.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 {
|
||||
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)]
|
||||
pub fn overlay<'a, S: AsRef<str>, Message: 'a>(
|
||||
layout: Layout<'_>,
|
||||
renderer: &crate::Renderer,
|
||||
_renderer: &crate::Renderer,
|
||||
state: &'a mut State,
|
||||
gap: f32,
|
||||
padding: Padding,
|
||||
text_size: f32,
|
||||
text_line_height: text::LineHeight,
|
||||
font: Option<crate::font::Font>,
|
||||
_text_line_height: text::LineHeight,
|
||||
_font: Option<crate::font::Font>,
|
||||
selections: &'a [S],
|
||||
selected_option: Option<usize>,
|
||||
on_selected: &'a dyn Fn(usize) -> Message,
|
||||
|
|
@ -440,7 +440,7 @@ pub fn overlay<'a, S: AsRef<str>, Message: 'a>(
|
|||
None,
|
||||
)
|
||||
.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()
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub fn resolve<Message>(
|
|||
|
||||
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.
|
||||
let child_node = child.as_widget().layout(tree, renderer, &limits);
|
||||
let size = child_node.size();
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ where
|
|||
let active_tree = &mut tree_children[active_root];
|
||||
state.menu_states.iter().enumerate().fold(
|
||||
(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 start_index = slice.start_index;
|
||||
let end_index = slice.end_index;
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ where
|
|||
&self,
|
||||
state: &mut LocalState,
|
||||
renderer: &Renderer,
|
||||
bounds: Size,
|
||||
_bounds: Size,
|
||||
) -> (f32, f32) {
|
||||
let mut width = 0.0f32;
|
||||
let mut height = 0.0f32;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,6 @@ pub struct TextInput<'a, Message> {
|
|||
leading_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,
|
||||
// (text_input::State, mime_type, dnd_action) -> Message
|
||||
on_create_dnd_source: Option<Box<dyn Fn(State) -> Message + 'a>>,
|
||||
on_dnd_command_produced: Option<Box<dyn Fn(DnDCommand) -> Message + 'a>>,
|
||||
surface_ids: Option<(window::Id, window::Id)>,
|
||||
|
|
@ -1074,10 +1073,10 @@ pub fn update<'a, Message>(
|
|||
on_paste: Option<&dyn Fn(String) -> Message>,
|
||||
on_submit: &Option<Message>,
|
||||
state: impl FnOnce() -> &'a mut State,
|
||||
on_start_dnd_source: Option<&dyn Fn(State) -> Message>,
|
||||
_dnd_icon: bool,
|
||||
on_dnd_command_produced: Option<&dyn Fn(DnDCommand) -> Message>,
|
||||
surface_ids: Option<(window::Id, window::Id)>,
|
||||
#[allow(unused_variables)] on_start_dnd_source: Option<&dyn Fn(State) -> Message>,
|
||||
#[allow(unused_variables)] dnd_icon: bool,
|
||||
#[allow(unused_variables)] on_dnd_command_produced: Option<&dyn Fn(DnDCommand) -> Message>,
|
||||
#[allow(unused_variables)] surface_ids: Option<(window::Id, window::Id)>,
|
||||
line_height: text::LineHeight,
|
||||
layout: Layout<'_>,
|
||||
) -> event::Status
|
||||
|
|
@ -1203,7 +1202,7 @@ where
|
|||
find_cursor_position(
|
||||
text_layout.bounds(),
|
||||
&value,
|
||||
&state,
|
||||
state,
|
||||
target,
|
||||
)
|
||||
} else {
|
||||
|
|
@ -2156,6 +2155,7 @@ pub struct State {
|
|||
pub label: crate::Paragraph,
|
||||
is_focused: Option<Focus>,
|
||||
dragging_state: Option<DraggingState>,
|
||||
#[cfg(feature = "wayland")]
|
||||
dnd_offer: DndOfferState,
|
||||
is_pasting: Option<Value>,
|
||||
last_click: Option<mouse::Click>,
|
||||
|
|
@ -2209,7 +2209,7 @@ impl State {
|
|||
|
||||
is_focused: None,
|
||||
dragging_state: None,
|
||||
#[allow(clippy::default_constructed_unit_structs)]
|
||||
#[cfg(feature = "wayland")]
|
||||
dnd_offer: DndOfferState::default(),
|
||||
is_pasting: None,
|
||||
last_click: None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue