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