diff options
author | Christian Duerr <contact@christianduerr.com> | 2024-10-05 10:02:51 +0200 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2024-10-07 01:02:10 +0200 |
commit | 709738f7b50e06166b15be9f28e33a54b159150b (patch) | |
tree | c85ad7b2040a233417d5a89b2f30e4cfb17f9af5 | |
parent | 6067787763e663bd308e5b724a5efafc2c54a3d1 (diff) | |
download | alacritty-709738f7b50e06166b15be9f28e33a54b159150b.tar.gz alacritty-709738f7b50e06166b15be9f28e33a54b159150b.zip |
Remove unused `Clone` requirements
-rw-r--r-- | alacritty_terminal/src/grid/mod.rs | 6 | ||||
-rw-r--r-- | alacritty_terminal/src/grid/resize.rs | 2 | ||||
-rw-r--r-- | alacritty_terminal/src/grid/row.rs | 2 | ||||
-rw-r--r-- | alacritty_terminal/src/grid/storage.rs | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs index 59769883..278bea3b 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -137,7 +137,7 @@ pub struct Grid<T> { max_scroll_limit: usize, } -impl<T: GridCell + Default + PartialEq + Clone> Grid<T> { +impl<T: GridCell + Default + PartialEq> Grid<T> { pub fn new(lines: usize, columns: usize, max_scroll_limit: usize) -> Grid<T> { Grid { raw: Storage::with_capacity(lines, columns), @@ -356,7 +356,7 @@ impl<T> Grid<T> { /// Reset a visible region within the grid. pub fn reset_region<D, R: RangeBounds<Line>>(&mut self, bounds: R) where - T: ResetDiscriminant<D> + GridCell + Clone + Default, + T: ResetDiscriminant<D> + GridCell + Default, D: PartialEq, { let start = match bounds.start_bound() { @@ -392,7 +392,7 @@ impl<T> Grid<T> { #[inline] pub fn initialize_all(&mut self) where - T: GridCell + Clone + Default, + T: GridCell + Default, { // Remove all cached lines to clear them of any content. self.truncate(); diff --git a/alacritty_terminal/src/grid/resize.rs b/alacritty_terminal/src/grid/resize.rs index 92ee55d7..751abae1 100644 --- a/alacritty_terminal/src/grid/resize.rs +++ b/alacritty_terminal/src/grid/resize.rs @@ -9,7 +9,7 @@ use crate::term::cell::{Flags, ResetDiscriminant}; use crate::grid::row::Row; use crate::grid::{Dimensions, Grid, GridCell}; -impl<T: GridCell + Default + PartialEq + Clone> Grid<T> { +impl<T: GridCell + Default + PartialEq> Grid<T> { /// Resize the grid's width and/or height. pub fn resize<D>(&mut self, reflow: bool, lines: usize, columns: usize) where diff --git a/alacritty_terminal/src/grid/row.rs b/alacritty_terminal/src/grid/row.rs index 4e22e50b..d4a6e6d3 100644 --- a/alacritty_terminal/src/grid/row.rs +++ b/alacritty_terminal/src/grid/row.rs @@ -30,7 +30,7 @@ impl<T: PartialEq> PartialEq for Row<T> { } } -impl<T: Clone + Default> Row<T> { +impl<T: Default> Row<T> { /// Create a new terminal row. /// /// Ideally the `template` should be `Copy` in all performance sensitive scenarios. diff --git a/alacritty_terminal/src/grid/storage.rs b/alacritty_terminal/src/grid/storage.rs index 0a2be43b..abf57103 100644 --- a/alacritty_terminal/src/grid/storage.rs +++ b/alacritty_terminal/src/grid/storage.rs @@ -66,7 +66,7 @@ impl<T> Storage<T> { #[inline] pub fn with_capacity(visible_lines: usize, columns: usize) -> Storage<T> where - T: Clone + Default, + T: Default, { // Initialize visible lines; the scrollback buffer is initialized dynamically. let mut inner = Vec::with_capacity(visible_lines); @@ -79,7 +79,7 @@ impl<T> Storage<T> { #[inline] pub fn grow_visible_lines(&mut self, next: usize) where - T: Clone + Default, + T: Default, { // Number of lines the buffer needs to grow. let additional_lines = next - self.visible_lines; @@ -125,7 +125,7 @@ impl<T> Storage<T> { #[inline] pub fn initialize(&mut self, additional_rows: usize, columns: usize) where - T: Clone + Default, + T: Default, { if self.len + additional_rows > self.inner.len() { self.rezero(); |