diff options
author | 2023-10-27 03:58:45 +0200 | |
---|---|---|
committer | 2023-10-27 03:58:45 +0200 | |
commit | 65823875791ecebf24d049cc0782e7475a37899b (patch) | |
tree | 1088c656ef7ad9782374952045022d2c104931b2 /core | |
parent | 8cc19de254c37d3123d5ea1b6513f1f34d35c7c8 (diff) | |
parent | f1b1344d59fa7354615f560bd25ed01ad0c9f865 (diff) | |
download | iced-65823875791ecebf24d049cc0782e7475a37899b.tar.gz iced-65823875791ecebf24d049cc0782e7475a37899b.tar.bz2 iced-65823875791ecebf24d049cc0782e7475a37899b.zip |
Merge branch 'master' into text-editor
Diffstat (limited to '')
-rw-r--r-- | core/src/color.rs | 2 | ||||
-rw-r--r-- | core/src/element.rs | 6 | ||||
-rw-r--r-- | core/src/gradient.rs | 4 | ||||
-rw-r--r-- | core/src/hasher.rs | 2 | ||||
-rw-r--r-- | core/src/lib.rs | 6 | ||||
-rw-r--r-- | core/src/mouse/click.rs | 2 | ||||
-rw-r--r-- | core/src/overlay/element.rs | 6 | ||||
-rw-r--r-- | core/src/overlay/group.rs | 2 | ||||
-rw-r--r-- | core/src/shell.rs | 2 | ||||
-rw-r--r-- | core/src/widget/operation/focusable.rs | 10 | ||||
-rw-r--r-- | core/src/widget/operation/scrollable.rs | 4 | ||||
-rw-r--r-- | core/src/widget/operation/text_input.rs | 8 | ||||
-rw-r--r-- | core/src/widget/text.rs | 2 | ||||
-rw-r--r-- | core/src/widget/tree.rs | 4 | ||||
-rw-r--r-- | core/src/window/icon.rs | 2 |
15 files changed, 28 insertions, 34 deletions
diff --git a/core/src/color.rs b/core/src/color.rs index cce8b340..13077628 100644 --- a/core/src/color.rs +++ b/core/src/color.rs @@ -1,7 +1,7 @@ #[cfg(feature = "palette")] use palette::rgb::{Srgb, Srgba}; -/// A color in the sRGB color space. +/// A color in the `sRGB` color space. #[derive(Debug, Clone, Copy, PartialEq, Default)] pub struct Color { /// Red component, 0.0 - 1.0 diff --git a/core/src/element.rs b/core/src/element.rs index 02f16bcb..dea111af 100644 --- a/core/src/element.rs +++ b/core/src/element.rs @@ -293,7 +293,7 @@ where } fn diff(&self, tree: &mut Tree) { - self.widget.diff(tree) + self.widget.diff(tree); } fn width(&self) -> Length { @@ -418,7 +418,7 @@ where viewport: &Rectangle, ) { self.widget - .draw(tree, renderer, theme, style, layout, cursor, viewport) + .draw(tree, renderer, theme, style, layout, cursor, viewport); } fn mouse_interaction( @@ -508,7 +508,7 @@ where ) { self.element .widget - .operate(state, layout, renderer, operation) + .operate(state, layout, renderer, operation); } fn on_event( diff --git a/core/src/gradient.rs b/core/src/gradient.rs index 4a0d5ea0..4711b044 100644 --- a/core/src/gradient.rs +++ b/core/src/gradient.rs @@ -94,8 +94,8 @@ impl Linear { mut self, stops: impl IntoIterator<Item = ColorStop>, ) -> Self { - for stop in stops.into_iter() { - self = self.add_stop(stop.offset, stop.color) + for stop in stops { + self = self.add_stop(stop.offset, stop.color); } self diff --git a/core/src/hasher.rs b/core/src/hasher.rs index fa52f16d..9d8f75b3 100644 --- a/core/src/hasher.rs +++ b/core/src/hasher.rs @@ -4,7 +4,7 @@ pub struct Hasher(twox_hash::XxHash64); impl core::hash::Hasher for Hasher { fn write(&mut self, bytes: &[u8]) { - self.0.write(bytes) + self.0.write(bytes); } fn finish(&self) -> u64 { diff --git a/core/src/lib.rs b/core/src/lib.rs index 13a9f06b..9eb3da34 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -14,14 +14,8 @@ missing_debug_implementations, // missing_docs, unused_results, - clippy::extra_unused_lifetimes, - clippy::from_over_into, - clippy::needless_borrow, - clippy::new_without_default, - clippy::useless_conversion, rustdoc::broken_intra_doc_links )] -#![allow(clippy::inherent_to_string, clippy::type_complexity)] pub mod alignment; pub mod clipboard; pub mod event; diff --git a/core/src/mouse/click.rs b/core/src/mouse/click.rs index e8e5fb56..b427da6c 100644 --- a/core/src/mouse/click.rs +++ b/core/src/mouse/click.rs @@ -24,7 +24,7 @@ pub enum Kind { } impl Kind { - fn next(&self) -> Kind { + fn next(self) -> Kind { match self { Kind::Single => Kind::Double, Kind::Double => Kind::Triple, diff --git a/core/src/overlay/element.rs b/core/src/overlay/element.rs index 689e69be..3dd58f9b 100644 --- a/core/src/overlay/element.rs +++ b/core/src/overlay/element.rs @@ -98,7 +98,7 @@ where layout: Layout<'_>, cursor: mouse::Cursor, ) { - self.overlay.draw(renderer, theme, style, layout, cursor) + self.overlay.draw(renderer, theme, style, layout, cursor); } /// Applies a [`widget::Operation`] to the [`Element`]. @@ -205,7 +205,7 @@ where state: &mut dyn widget::operation::TextInput, id: Option<&widget::Id>, ) { - self.operation.text_input(state, id) + self.operation.text_input(state, id); } fn custom(&mut self, state: &mut dyn Any, id: Option<&widget::Id>) { @@ -262,7 +262,7 @@ where layout: Layout<'_>, cursor: mouse::Cursor, ) { - self.content.draw(renderer, theme, style, layout, cursor) + self.content.draw(renderer, theme, style, layout, cursor); } fn is_over( diff --git a/core/src/overlay/group.rs b/core/src/overlay/group.rs index a0bae6bb..dccf6dba 100644 --- a/core/src/overlay/group.rs +++ b/core/src/overlay/group.rs @@ -143,7 +143,7 @@ where |(child, layout)| { child.operate(layout, renderer, operation); }, - ) + ); }); } diff --git a/core/src/shell.rs b/core/src/shell.rs index 246c937a..2952ceff 100644 --- a/core/src/shell.rs +++ b/core/src/shell.rs @@ -71,7 +71,7 @@ impl<'a, Message> Shell<'a, Message> { if self.is_layout_invalid { self.is_layout_invalid = false; - f() + f(); } } diff --git a/core/src/widget/operation/focusable.rs b/core/src/widget/operation/focusable.rs index ab1b677e..68c22faa 100644 --- a/core/src/widget/operation/focusable.rs +++ b/core/src/widget/operation/focusable.rs @@ -49,7 +49,7 @@ pub fn focus<T>(target: Id) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } @@ -85,7 +85,7 @@ where _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } fn finish(&self) -> Outcome<T> { @@ -132,7 +132,7 @@ pub fn focus_previous<T>() -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } @@ -166,7 +166,7 @@ pub fn focus_next<T>() -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } @@ -193,7 +193,7 @@ pub fn find_focused() -> impl Operation<Id> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<Id>), ) { - operate_on_children(self) + operate_on_children(self); } fn finish(&self) -> Outcome<Id> { diff --git a/core/src/widget/operation/scrollable.rs b/core/src/widget/operation/scrollable.rs index 4f8b2a98..12161255 100644 --- a/core/src/widget/operation/scrollable.rs +++ b/core/src/widget/operation/scrollable.rs @@ -26,7 +26,7 @@ pub fn snap_to<T>(target: Id, offset: RelativeOffset) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } fn scrollable( @@ -60,7 +60,7 @@ pub fn scroll_to<T>(target: Id, offset: AbsoluteOffset) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } fn scrollable( diff --git a/core/src/widget/operation/text_input.rs b/core/src/widget/operation/text_input.rs index a9ea2e81..41731d4c 100644 --- a/core/src/widget/operation/text_input.rs +++ b/core/src/widget/operation/text_input.rs @@ -38,7 +38,7 @@ pub fn move_cursor_to_front<T>(target: Id) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } @@ -68,7 +68,7 @@ pub fn move_cursor_to_end<T>(target: Id) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } @@ -99,7 +99,7 @@ pub fn move_cursor_to<T>(target: Id, position: usize) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } @@ -128,7 +128,7 @@ pub fn select_all<T>(target: Id) -> impl Operation<T> { _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>), ) { - operate_on_children(self) + operate_on_children(self); } } diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index c7c9f539..97e0acac 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -218,9 +218,9 @@ where size, line_height, font, - shaping, horizontal_alignment, vertical_alignment, + shaping, }); let size = limits.resolve(paragraph.min_bounds()); diff --git a/core/src/widget/tree.rs b/core/src/widget/tree.rs index 202cca9a..d4b8828a 100644 --- a/core/src/widget/tree.rs +++ b/core/src/widget/tree.rs @@ -61,7 +61,7 @@ impl Tree { Renderer: crate::Renderer, { if self.tag == new.borrow().tag() { - new.borrow().diff(self) + new.borrow().diff(self); } else { *self = Self::new(new); } @@ -78,7 +78,7 @@ impl Tree { new_children, |tree, widget| tree.diff(widget.borrow()), |widget| Self::new(widget.borrow()), - ) + ); } /// Reconciliates the children of the tree with the provided list of widgets using custom diff --git a/core/src/window/icon.rs b/core/src/window/icon.rs index 2fc48e3b..5ef0eed7 100644 --- a/core/src/window/icon.rs +++ b/core/src/window/icon.rs @@ -3,7 +3,7 @@ use crate::Size; use std::mem; -/// Builds an [`Icon`] from its RGBA pixels in the sRGB color space. +/// Builds an [`Icon`] from its RGBA pixels in the `sRGB` color space. pub fn from_rgba( rgba: Vec<u8>, width: u32, |