mirror of
https://github.com/zellij-org/zellij.git
synced 2024-12-24 01:34:38 +03:00
fix(style): remove redundant .clone()
calls (#1085)
This commit is contained in:
parent
645735f571
commit
e73ce08ddf
@ -793,7 +793,7 @@ impl FloatingPanes {
|
||||
viewport,
|
||||
);
|
||||
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();
|
||||
true
|
||||
}
|
||||
@ -809,7 +809,7 @@ impl FloatingPanes {
|
||||
if show_panes && clicked_on_frame {
|
||||
let pid = pane.pid();
|
||||
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.set_force_render();
|
||||
|
@ -464,7 +464,7 @@ impl TerminalPane {
|
||||
position_and_size.rows.as_usize(),
|
||||
position_and_size.cols.as_usize(),
|
||||
palette,
|
||||
link_handler.clone(),
|
||||
link_handler,
|
||||
);
|
||||
TerminalPane {
|
||||
frame: HashMap::new(),
|
||||
|
@ -142,23 +142,23 @@ impl PaneFrame {
|
||||
}
|
||||
}
|
||||
fn render_my_focus(&self, max_length: usize) -> Option<(Vec<TerminalCharacter>, usize)> {
|
||||
let left_separator = foreground_color(boundary_type::VERTICAL_LEFT, self.color);
|
||||
let right_separator = foreground_color(boundary_type::VERTICAL_RIGHT, self.color);
|
||||
let mut left_separator = foreground_color(boundary_type::VERTICAL_LEFT, self.color);
|
||||
let mut right_separator = foreground_color(boundary_type::VERTICAL_RIGHT, self.color);
|
||||
let full_indication_text = "MY FOCUS";
|
||||
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.append(&mut foreground_color(full_indication_text, self.color));
|
||||
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 short_indication_text = "ME";
|
||||
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.append(&mut foreground_color(short_indication_text, self.color));
|
||||
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
|
||||
if full_indication_len <= max_length {
|
||||
Some((full_indication, full_indication_len))
|
||||
|
Loading…
Reference in New Issue
Block a user