aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid/row.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src/grid/row.rs')
-rw-r--r--alacritty_terminal/src/grid/row.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/alacritty_terminal/src/grid/row.rs b/alacritty_terminal/src/grid/row.rs
index 22a10625..b5248ad7 100644
--- a/alacritty_terminal/src/grid/row.rs
+++ b/alacritty_terminal/src/grid/row.rs
@@ -43,20 +43,20 @@ impl<T: PartialEq> PartialEq for Row<T> {
}
impl<T: Copy> Row<T> {
- pub fn new(columns: Column, template: &T) -> Row<T>
+ pub fn new(columns: Column, template: T) -> Row<T>
where
T: GridCell,
{
let occ = if template.is_empty() { 0 } else { columns.0 };
- Row { inner: vec![*template; columns.0], occ }
+ Row { inner: vec![template; columns.0], occ }
}
- pub fn grow(&mut self, cols: Column, template: &T) {
+ pub fn grow(&mut self, cols: Column, template: T) {
if self.inner.len() >= cols.0 {
return;
}
- self.inner.append(&mut vec![*template; cols.0 - self.len()]);
+ self.inner.append(&mut vec![template; cols.0 - self.len()]);
}
pub fn shrink(&mut self, cols: Column) -> Option<Vec<T>>
@@ -83,14 +83,12 @@ impl<T: Copy> Row<T> {
/// Reset all cells in the row to the `template` cell.
#[inline]
- pub fn reset(&mut self, template: &T)
+ pub fn reset(&mut self, template: T)
where
T: GridCell + PartialEq,
{
debug_assert!(!self.inner.is_empty());
- let template = *template;
-
// Mark all cells as dirty if template cell changed.
let len = self.inner.len();
if !self.inner[len - 1].fast_eq(template) {