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
|
|
@ -61,11 +61,8 @@ impl Application for Example {
|
|||
fn update(&mut self, message: Message) -> Command<Message> {
|
||||
match message {
|
||||
Message::Split(axis, pane) => {
|
||||
let result = self.panes.split(
|
||||
axis,
|
||||
&pane,
|
||||
Pane::new(self.panes_created),
|
||||
);
|
||||
let result =
|
||||
self.panes.split(axis, pane, Pane::new(self.panes_created));
|
||||
|
||||
if let Some((pane, _)) = result {
|
||||
self.focus = Some(pane);
|
||||
|
|
@ -77,7 +74,7 @@ impl Application for Example {
|
|||
if let Some(pane) = self.focus {
|
||||
let result = self.panes.split(
|
||||
axis,
|
||||
&pane,
|
||||
pane,
|
||||
Pane::new(self.panes_created),
|
||||
);
|
||||
|
||||
|
|
@ -90,8 +87,7 @@ impl Application for Example {
|
|||
}
|
||||
Message::FocusAdjacent(direction) => {
|
||||
if let Some(pane) = self.focus {
|
||||
if let Some(adjacent) =
|
||||
self.panes.adjacent(&pane, direction)
|
||||
if let Some(adjacent) = self.panes.adjacent(pane, direction)
|
||||
{
|
||||
self.focus = Some(adjacent);
|
||||
}
|
||||
|
|
@ -101,37 +97,34 @@ impl Application for Example {
|
|||
self.focus = Some(pane);
|
||||
}
|
||||
Message::Resized(pane_grid::ResizeEvent { split, ratio }) => {
|
||||
self.panes.resize(&split, ratio);
|
||||
self.panes.resize(split, ratio);
|
||||
}
|
||||
Message::Dragged(pane_grid::DragEvent::Dropped {
|
||||
pane,
|
||||
target,
|
||||
}) => {
|
||||
self.panes.drop(&pane, target);
|
||||
self.panes.drop(pane, target);
|
||||
}
|
||||
Message::Dragged(_) => {}
|
||||
Message::TogglePin(pane) => {
|
||||
if let Some(Pane { is_pinned, .. }) = self.panes.get_mut(&pane)
|
||||
{
|
||||
if let Some(Pane { is_pinned, .. }) = self.panes.get_mut(pane) {
|
||||
*is_pinned = !*is_pinned;
|
||||
}
|
||||
}
|
||||
Message::Maximize(pane) => self.panes.maximize(&pane),
|
||||
Message::Maximize(pane) => self.panes.maximize(pane),
|
||||
Message::Restore => {
|
||||
self.panes.restore();
|
||||
}
|
||||
Message::Close(pane) => {
|
||||
if let Some((_, sibling)) = self.panes.close(&pane) {
|
||||
if let Some((_, sibling)) = self.panes.close(pane) {
|
||||
self.focus = Some(sibling);
|
||||
}
|
||||
}
|
||||
Message::CloseFocused => {
|
||||
if let Some(pane) = self.focus {
|
||||
if let Some(Pane { is_pinned, .. }) = self.panes.get(&pane)
|
||||
{
|
||||
if let Some(Pane { is_pinned, .. }) = self.panes.get(pane) {
|
||||
if !is_pinned {
|
||||
if let Some((_, sibling)) = self.panes.close(&pane)
|
||||
{
|
||||
if let Some((_, sibling)) = self.panes.close(pane) {
|
||||
self.focus = Some(sibling);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ pub enum Filter {
|
|||
}
|
||||
|
||||
impl Filter {
|
||||
fn matches(&self, task: &Task) -> bool {
|
||||
fn matches(self, task: &Task) -> bool {
|
||||
match self {
|
||||
Filter::All => true,
|
||||
Filter::Active => !task.completed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue