refactor(rectange tracker): relax Copy to Clone (#1331)

- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
This commit is contained in:
Jeremy Soller 2026-07-07 06:26:01 -06:00 • committed by GitHub
commit be41927859
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@ use iced::futures::channel::mpsc::UnboundedSender;
use iced::widget::Container;
pub use subscription::*;
use iced_core::event::{self, Event};
use iced_core::event::Event;
use iced_core::widget::Tree;
use iced_core::{
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, layout,
@ -44,7 +44,7 @@ pub struct RectangleTracker<I> {
impl<I> RectangleTracker<I>
where
I: Hash + Copy + Send + Sync + Debug,
I: Hash + Clone + Send + Sync + Debug,
{
pub fn container<'a, Message: 'static, T>(
&self,
@ -185,7 +185,7 @@ impl<'a, Message, Renderer, I> Widget<Message, crate::Theme, Renderer>
for RectangleTrackingContainer<'a, Message, Renderer, I>
where
Renderer: iced_core::Renderer,
I: 'a + Hash + Copy + Send + Sync + Debug,
I: 'a + Hash + Clone + Send + Sync + Debug,
{
fn children(&self) -> Vec<Tree> {
self.container.children()
@ -275,7 +275,7 @@ where
cursor_position: mouse::Cursor,
viewport: &Rectangle,
) {
let _ = self.tx.unbounded_send((self.id, layout.bounds()));
let _ = self.tx.unbounded_send((self.id.clone(), layout.bounds()));
self.container.draw(
tree,
renderer,
@ -327,7 +327,7 @@ impl<'a, Message, Renderer, I> From<RectangleTrackingContainer<'a, Message, Rend
where
Message: 'a,
Renderer: 'a + iced_core::Renderer,
I: 'a + Hash + Copy + Send + Sync + Debug,
I: 'a + Hash + Clone + Send + Sync + Debug,
{
fn from(
column: RectangleTrackingContainer<'a, Message, Renderer, I>,