Prefix _ instead of allow(unused) in Component trait

This commit is contained in:
Héctor Ramón Jiménez 2023-01-02 19:32:47 +01:00
parent 8d5fba8a1f
commit cec28e2ef5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -48,10 +48,12 @@ pub trait Component<Message, Renderer> {
fn view(&self, state: &Self::State) -> Element<'_, Self::Event, Renderer>;
/// Update the [`Component`] state based on the provided [`Operation`](widget::Operation)
///
/// By default, it does nothing.
fn operate(
&self,
#[allow(unused)] state: &mut Self::State,
#[allow(unused)] operation: &mut dyn widget::Operation<Message>,
_state: &mut Self::State,
_operation: &mut dyn widget::Operation<Message>,
) {
}
}