diff options
author | 2022-07-09 18:03:59 +0200 | |
---|---|---|
committer | 2022-07-09 18:03:59 +0200 | |
commit | 2f76a10a1d3617e414fb33c0c6cd5cb7782197ad (patch) | |
tree | c5c1d4e9e29752abc15d1f3559369e42c1bbb772 /lazy | |
parent | 33a24b58210c88571f789ee27495e3ee3a55e3a4 (diff) | |
download | iced-2f76a10a1d3617e414fb33c0c6cd5cb7782197ad.tar.gz iced-2f76a10a1d3617e414fb33c0c6cd5cb7782197ad.tar.bz2 iced-2f76a10a1d3617e414fb33c0c6cd5cb7782197ad.zip |
Fix further `clippy` lints
... and explicitly annotate crates as well.
Diffstat (limited to 'lazy')
-rw-r--r-- | lazy/src/component.rs | 4 | ||||
-rw-r--r-- | lazy/src/lib.rs | 11 | ||||
-rw-r--r-- | lazy/src/pure/component.rs | 4 | ||||
-rw-r--r-- | lazy/src/pure/responsive.rs | 2 | ||||
-rw-r--r-- | lazy/src/responsive.rs | 2 |
5 files changed, 17 insertions, 6 deletions
diff --git a/lazy/src/component.rs b/lazy/src/component.rs index 2c6b6ffb..847afbd8 100644 --- a/lazy/src/component.rs +++ b/lazy/src/component.rs @@ -38,7 +38,7 @@ pub trait Component<Message, Renderer> { /// Produces the widgets of the [`Component`], which may trigger an [`Event`](Component::Event) /// on user interaction. - fn view(&mut self) -> Element<Self::Event, Renderer>; + fn view(&mut self) -> Element<'_, Self::Event, Renderer>; } /// Turns an implementor of [`Component`] into an [`Element`] that can be @@ -350,7 +350,7 @@ where layout: Layout<'_>, cursor_position: Point, ) { - self.with_overlay_maybe(|overlay| { + let _ = self.with_overlay_maybe(|overlay| { overlay.draw(renderer, theme, style, layout, cursor_position); }); } diff --git a/lazy/src/lib.rs b/lazy/src/lib.rs index 916f9458..7dc294cf 100644 --- a/lazy/src/lib.rs +++ b/lazy/src/lib.rs @@ -1,6 +1,17 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![deny( + missing_debug_implementations, + unused_results, + clippy::extra_unused_lifetimes, + clippy::from_over_into, + clippy::needless_borrow, + clippy::new_without_default, + clippy::useless_conversion +)] +#![forbid(unsafe_code)] +#![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_cfg))] pub mod component; pub mod responsive; diff --git a/lazy/src/pure/component.rs b/lazy/src/pure/component.rs index 9b29b628..b8370263 100644 --- a/lazy/src/pure/component.rs +++ b/lazy/src/pure/component.rs @@ -43,7 +43,7 @@ pub trait Component<Message, Renderer> { /// Produces the widgets of the [`Component`], which may trigger an [`Event`](Component::Event) /// on user interaction. - fn view(&self, state: &Self::State) -> Element<Self::Event, Renderer>; + fn view(&self, state: &Self::State) -> Element<'_, Self::Event, Renderer>; } /// Turns an implementor of [`Component`] into an [`Element`] that can be @@ -382,7 +382,7 @@ where layout: Layout<'_>, cursor_position: Point, ) { - self.with_overlay_maybe(|overlay| { + let _ = self.with_overlay_maybe(|overlay| { overlay.draw(renderer, theme, style, layout, cursor_position); }); } diff --git a/lazy/src/pure/responsive.rs b/lazy/src/pure/responsive.rs index 96b89fd6..d156f805 100644 --- a/lazy/src/pure/responsive.rs +++ b/lazy/src/pure/responsive.rs @@ -341,7 +341,7 @@ where layout: Layout<'_>, cursor_position: Point, ) { - self.with_overlay_maybe(|overlay| { + let _ = self.with_overlay_maybe(|overlay| { overlay.draw(renderer, theme, style, layout, cursor_position); }); } diff --git a/lazy/src/responsive.rs b/lazy/src/responsive.rs index 86c8db6b..d305689d 100644 --- a/lazy/src/responsive.rs +++ b/lazy/src/responsive.rs @@ -363,7 +363,7 @@ where layout: Layout<'_>, cursor_position: Point, ) { - self.with_overlay_maybe(|overlay| { + let _ = self.with_overlay_maybe(|overlay| { overlay.draw(renderer, theme, style, layout, cursor_position); }); } |