Fix clippy::trivially-copy-pass-by-ref
This commit is contained in:
parent
34f07b6027
commit
6c386e90a1
6 changed files with 48 additions and 55 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue