summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-03 03:22:10 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-04 01:26:59 +0100
commitafef368d8a920c7702048d3b1604b2046fe46ff8 (patch)
tree956ce409f5969cfd6b163796f141213c6235b805 /core
parent1b01d6718bf0c6b652a3256df51727c3e72fdd9e (diff)
downloadiced-afef368d8a920c7702048d3b1604b2046fe46ff8.tar.gz
iced-afef368d8a920c7702048d3b1604b2046fe46ff8.tar.bz2
iced-afef368d8a920c7702048d3b1604b2046fe46ff8.zip
Take `Event` by reference in `Widget::update`
Diffstat (limited to 'core')
-rw-r--r--core/src/element.rs4
-rw-r--r--core/src/overlay.rs2
-rw-r--r--core/src/overlay/element.rs4
-rw-r--r--core/src/overlay/group.rs11
-rw-r--r--core/src/widget.rs2
5 files changed, 8 insertions, 15 deletions
diff --git a/core/src/element.rs b/core/src/element.rs
index 82ba753b..ede9e16c 100644
--- a/core/src/element.rs
+++ b/core/src/element.rs
@@ -311,7 +311,7 @@ where
fn update(
&mut self,
tree: &mut Tree,
- event: Event,
+ event: &Event,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
@@ -447,7 +447,7 @@ where
fn update(
&mut self,
state: &mut Tree,
- event: Event,
+ event: &Event,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
diff --git a/core/src/overlay.rs b/core/src/overlay.rs
index 383663af..94239152 100644
--- a/core/src/overlay.rs
+++ b/core/src/overlay.rs
@@ -58,7 +58,7 @@ where
/// By default, it does nothing.
fn update(
&mut self,
- _event: Event,
+ _event: &Event,
_layout: Layout<'_>,
_cursor: mouse::Cursor,
_renderer: &Renderer,
diff --git a/core/src/overlay/element.rs b/core/src/overlay/element.rs
index 7a179663..de6e73fd 100644
--- a/core/src/overlay/element.rs
+++ b/core/src/overlay/element.rs
@@ -51,7 +51,7 @@ where
/// Processes a runtime [`Event`].
pub fn update(
&mut self,
- event: Event,
+ event: &Event,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
@@ -150,7 +150,7 @@ where
fn update(
&mut self,
- event: Event,
+ event: &Event,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
diff --git a/core/src/overlay/group.rs b/core/src/overlay/group.rs
index e07744e3..970c1b0e 100644
--- a/core/src/overlay/group.rs
+++ b/core/src/overlay/group.rs
@@ -74,7 +74,7 @@ where
fn update(
&mut self,
- event: Event,
+ event: &Event,
layout: Layout<'_>,
cursor: mouse::Cursor,
renderer: &Renderer,
@@ -82,14 +82,7 @@ where
shell: &mut Shell<'_, Message>,
) {
for (child, layout) in self.children.iter_mut().zip(layout.children()) {
- child.update(
- event.clone(),
- layout,
- cursor,
- renderer,
- clipboard,
- shell,
- );
+ child.update(event, layout, cursor, renderer, clipboard, shell);
}
}
diff --git a/core/src/widget.rs b/core/src/widget.rs
index 2a40f823..3c9c50ab 100644
--- a/core/src/widget.rs
+++ b/core/src/widget.rs
@@ -114,7 +114,7 @@ where
fn update(
&mut self,
_state: &mut Tree,
- _event: Event,
+ _event: &Event,
_layout: Layout<'_>,
_cursor: mouse::Cursor,
_renderer: &Renderer,