Skip to content

Commit

Permalink
remove underscores from provided Widget methods' arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
edwloef committed Nov 28, 2024
1 parent e8f8216 commit eba1d40
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions core/src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,56 +96,66 @@ where
}

/// Reconciles the [`Widget`] with the provided [`Tree`].
fn diff(&self, _tree: &mut Tree) {}
fn diff(&self, tree: &mut Tree) {
let _ = tree;
}

/// Applies an [`Operation`] to the [`Widget`].
fn operate(
&self,
_state: &mut Tree,
_layout: Layout<'_>,
_renderer: &Renderer,
_operation: &mut dyn Operation,
state: &mut Tree,
layout: Layout<'_>,
renderer: &Renderer,
operation: &mut dyn Operation,
) {
let _ = (state, layout, renderer, operation);
}

/// Processes a runtime [`Event`].
///
/// By default, it does nothing.
fn update(
&mut self,
_state: &mut Tree,
_event: Event,
_layout: Layout<'_>,
_cursor: mouse::Cursor,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
state: &mut Tree,
event: Event,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
) {
let _ = (
state, event, layout, cursor, renderer, clipboard, shell, viewport,
);
}

/// Returns the current [`mouse::Interaction`] of the [`Widget`].
///
/// By default, it returns [`mouse::Interaction::Idle`].
fn mouse_interaction(
&self,
_state: &Tree,
_layout: Layout<'_>,
_cursor: mouse::Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
state: &Tree,
layout: Layout<'_>,
cursor: mouse::Cursor,
viewport: &Rectangle,
renderer: &Renderer,
) -> mouse::Interaction {
let _ = (state, layout, cursor, viewport, renderer);

mouse::Interaction::None
}

/// Returns the overlay of the [`Widget`], if there is any.
fn overlay<'a>(
&'a mut self,
_state: &'a mut Tree,
_layout: Layout<'_>,
_renderer: &Renderer,
_translation: Vector,
state: &'a mut Tree,
layout: Layout<'_>,
renderer: &Renderer,
translation: Vector,
) -> Option<overlay::Element<'a, Message, Theme, Renderer>> {
let _ = (state, layout, renderer, translation);

None
}
}

0 comments on commit eba1d40

Please sign in to comment.