1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05: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,
}
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();

View file

@ -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

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.
///
/// Ideally the `template` should be `Copy` in all performance sensitive scenarios.

View file

@ -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();