1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2025-03-10 17:17:19 -04:00

Remove unused Clone requirements

This commit is contained in:
Christian Duerr 2024-10-05 10:02:51 +02:00
parent 6067787763
commit 709738f7b5
4 changed files with 8 additions and 8 deletions

View file

@ -137,7 +137,7 @@ pub struct Grid<T> {
max_scroll_limit: usize, 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> { pub fn new(lines: usize, columns: usize, max_scroll_limit: usize) -> Grid<T> {
Grid { Grid {
raw: Storage::with_capacity(lines, columns), raw: Storage::with_capacity(lines, columns),
@ -356,7 +356,7 @@ impl<T> Grid<T> {
/// Reset a visible region within the grid. /// Reset a visible region within the grid.
pub fn reset_region<D, R: RangeBounds<Line>>(&mut self, bounds: R) pub fn reset_region<D, R: RangeBounds<Line>>(&mut self, bounds: R)
where where
T: ResetDiscriminant<D> + GridCell + Clone + Default, T: ResetDiscriminant<D> + GridCell + Default,
D: PartialEq, D: PartialEq,
{ {
let start = match bounds.start_bound() { let start = match bounds.start_bound() {
@ -392,7 +392,7 @@ impl<T> Grid<T> {
#[inline] #[inline]
pub fn initialize_all(&mut self) pub fn initialize_all(&mut self)
where where
T: GridCell + Clone + Default, T: GridCell + Default,
{ {
// Remove all cached lines to clear them of any content. // Remove all cached lines to clear them of any content.
self.truncate(); self.truncate();

View file

@ -9,7 +9,7 @@ use crate::term::cell::{Flags, ResetDiscriminant};
use crate::grid::row::Row; use crate::grid::row::Row;
use crate::grid::{Dimensions, Grid, GridCell}; 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. /// Resize the grid's width and/or height.
pub fn resize<D>(&mut self, reflow: bool, lines: usize, columns: usize) pub fn resize<D>(&mut self, reflow: bool, lines: usize, columns: usize)
where where

View file

@ -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. /// Create a new terminal row.
/// ///
/// Ideally the `template` should be `Copy` in all performance sensitive scenarios. /// Ideally the `template` should be `Copy` in all performance sensitive scenarios.

View file

@ -66,7 +66,7 @@ impl<T> Storage<T> {
#[inline] #[inline]
pub fn with_capacity(visible_lines: usize, columns: usize) -> Storage<T> pub fn with_capacity(visible_lines: usize, columns: usize) -> Storage<T>
where where
T: Clone + Default, T: Default,
{ {
// Initialize visible lines; the scrollback buffer is initialized dynamically. // Initialize visible lines; the scrollback buffer is initialized dynamically.
let mut inner = Vec::with_capacity(visible_lines); let mut inner = Vec::with_capacity(visible_lines);
@ -79,7 +79,7 @@ impl<T> Storage<T> {
#[inline] #[inline]
pub fn grow_visible_lines(&mut self, next: usize) pub fn grow_visible_lines(&mut self, next: usize)
where where
T: Clone + Default, T: Default,
{ {
// Number of lines the buffer needs to grow. // Number of lines the buffer needs to grow.
let additional_lines = next - self.visible_lines; let additional_lines = next - self.visible_lines;
@ -125,7 +125,7 @@ impl<T> Storage<T> {
#[inline] #[inline]
pub fn initialize(&mut self, additional_rows: usize, columns: usize) pub fn initialize(&mut self, additional_rows: usize, columns: usize)
where where
T: Clone + Default, T: Default,
{ {
if self.len + additional_rows > self.inner.len() { if self.len + additional_rows > self.inner.len() {
self.rezero(); self.rezero();