diff options
author | 2023-09-20 04:33:48 +0200 | |
---|---|---|
committer | 2023-09-20 04:33:48 +0200 | |
commit | 6c386e90a12fd26da12541da3f086dddb7211c0c (patch) | |
tree | 9f1fd02a8814b80320bbd4b4df85fb8c7cb65ff9 /widget/src/pane_grid/node.rs | |
parent | 34f07b60273d6cfe13834af54cd0e24d34569387 (diff) | |
download | iced-6c386e90a12fd26da12541da3f086dddb7211c0c.tar.gz iced-6c386e90a12fd26da12541da3f086dddb7211c0c.tar.bz2 iced-6c386e90a12fd26da12541da3f086dddb7211c0c.zip |
Fix `clippy::trivially-copy-pass-by-ref`
Diffstat (limited to 'widget/src/pane_grid/node.rs')
-rw-r--r-- | widget/src/pane_grid/node.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/widget/src/pane_grid/node.rs b/widget/src/pane_grid/node.rs index 3c707f15..1f568f95 100644 --- a/widget/src/pane_grid/node.rs +++ b/widget/src/pane_grid/node.rs @@ -95,13 +95,13 @@ impl Node { splits } - pub(crate) fn find(&mut self, pane: &Pane) -> Option<&mut Node> { + pub(crate) fn find(&mut self, pane: Pane) -> Option<&mut Node> { match self { Node::Split { a, b, .. } => { a.find(pane).or_else(move || b.find(pane)) } Node::Pane(p) => { - if p == pane { + if *p == pane { Some(self) } else { None @@ -139,12 +139,12 @@ impl Node { f(self); } - pub(crate) fn resize(&mut self, split: &Split, percentage: f32) -> bool { + pub(crate) fn resize(&mut self, split: Split, percentage: f32) -> bool { match self { Node::Split { id, ratio, a, b, .. } => { - if id == split { + if *id == split { *ratio = percentage; true @@ -158,13 +158,13 @@ impl Node { } } - pub(crate) fn remove(&mut self, pane: &Pane) -> Option<Pane> { + pub(crate) fn remove(&mut self, pane: Pane) -> Option<Pane> { match self { Node::Split { a, b, .. } => { - if a.pane() == Some(*pane) { + if a.pane() == Some(pane) { *self = *b.clone(); Some(self.first_pane()) - } else if b.pane() == Some(*pane) { + } else if b.pane() == Some(pane) { *self = *a.clone(); Some(self.first_pane()) } else { |