fix(style): remove redundant .clone() calls (#1085)
This commit is contained in:
parent
645735f571
commit
e73ce08ddf
3 changed files with 9 additions and 9 deletions
|
|
@ -793,7 +793,7 @@ impl FloatingPanes {
|
||||||
viewport,
|
viewport,
|
||||||
);
|
);
|
||||||
floating_pane_grid.move_pane_by(pane_id, move_x_by, move_y_by);
|
floating_pane_grid.move_pane_by(pane_id, move_x_by, move_y_by);
|
||||||
self.set_pane_being_moved_with_mouse(pane_id, click_position.clone());
|
self.set_pane_being_moved_with_mouse(pane_id, *click_position);
|
||||||
self.set_force_render();
|
self.set_force_render();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
@ -809,7 +809,7 @@ impl FloatingPanes {
|
||||||
if show_panes && clicked_on_frame {
|
if show_panes && clicked_on_frame {
|
||||||
let pid = pane.pid();
|
let pid = pane.pid();
|
||||||
if self.pane_being_moved_with_mouse.is_none() {
|
if self.pane_being_moved_with_mouse.is_none() {
|
||||||
self.set_pane_being_moved_with_mouse(pid, position.clone());
|
self.set_pane_being_moved_with_mouse(pid, position);
|
||||||
}
|
}
|
||||||
self.move_pane_to_position(&position);
|
self.move_pane_to_position(&position);
|
||||||
self.set_force_render();
|
self.set_force_render();
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,7 @@ impl TerminalPane {
|
||||||
position_and_size.rows.as_usize(),
|
position_and_size.rows.as_usize(),
|
||||||
position_and_size.cols.as_usize(),
|
position_and_size.cols.as_usize(),
|
||||||
palette,
|
palette,
|
||||||
link_handler.clone(),
|
link_handler,
|
||||||
);
|
);
|
||||||
TerminalPane {
|
TerminalPane {
|
||||||
frame: HashMap::new(),
|
frame: HashMap::new(),
|
||||||
|
|
|
||||||
|
|
@ -142,23 +142,23 @@ impl PaneFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn render_my_focus(&self, max_length: usize) -> Option<(Vec<TerminalCharacter>, usize)> {
|
fn render_my_focus(&self, max_length: usize) -> Option<(Vec<TerminalCharacter>, usize)> {
|
||||||
let left_separator = foreground_color(boundary_type::VERTICAL_LEFT, self.color);
|
let mut left_separator = foreground_color(boundary_type::VERTICAL_LEFT, self.color);
|
||||||
let right_separator = foreground_color(boundary_type::VERTICAL_RIGHT, self.color);
|
let mut right_separator = foreground_color(boundary_type::VERTICAL_RIGHT, self.color);
|
||||||
let full_indication_text = "MY FOCUS";
|
let full_indication_text = "MY FOCUS";
|
||||||
let mut full_indication = vec![];
|
let mut full_indication = vec![];
|
||||||
full_indication.append(&mut left_separator.clone());
|
full_indication.append(&mut left_separator);
|
||||||
full_indication.push(EMPTY_TERMINAL_CHARACTER);
|
full_indication.push(EMPTY_TERMINAL_CHARACTER);
|
||||||
full_indication.append(&mut foreground_color(full_indication_text, self.color));
|
full_indication.append(&mut foreground_color(full_indication_text, self.color));
|
||||||
full_indication.push(EMPTY_TERMINAL_CHARACTER);
|
full_indication.push(EMPTY_TERMINAL_CHARACTER);
|
||||||
full_indication.append(&mut right_separator.clone());
|
full_indication.append(&mut right_separator);
|
||||||
let full_indication_len = full_indication_text.width() + 4; // 2 for separators 2 for padding
|
let full_indication_len = full_indication_text.width() + 4; // 2 for separators 2 for padding
|
||||||
let short_indication_text = "ME";
|
let short_indication_text = "ME";
|
||||||
let mut short_indication = vec![];
|
let mut short_indication = vec![];
|
||||||
short_indication.append(&mut left_separator.clone());
|
short_indication.append(&mut left_separator);
|
||||||
short_indication.push(EMPTY_TERMINAL_CHARACTER);
|
short_indication.push(EMPTY_TERMINAL_CHARACTER);
|
||||||
short_indication.append(&mut foreground_color(short_indication_text, self.color));
|
short_indication.append(&mut foreground_color(short_indication_text, self.color));
|
||||||
short_indication.push(EMPTY_TERMINAL_CHARACTER);
|
short_indication.push(EMPTY_TERMINAL_CHARACTER);
|
||||||
short_indication.append(&mut right_separator.clone());
|
short_indication.append(&mut right_separator);
|
||||||
let short_indication_len = short_indication_text.width() + 4; // 2 for separators 2 for padding
|
let short_indication_len = short_indication_text.width() + 4; // 2 for separators 2 for padding
|
||||||
if full_indication_len <= max_length {
|
if full_indication_len <= max_length {
|
||||||
Some((full_indication, full_indication_len))
|
Some((full_indication, full_indication_len))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue