From 4347e3e8d6aa97eb5408b2d77001ce21eccc998e Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Sat, 29 Jan 2022 17:31:14 +0100 Subject: [PATCH] derive 'Default' where possible --- src/row.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/row.rs b/src/row.rs index d178f21..1ea5e5f 100644 --- a/src/row.rs +++ b/src/row.rs @@ -5,7 +5,7 @@ use unicode_width::UnicodeWidthStr; use crate::cell::{Cell, Cells}; /// Each row contains [Cells](crate::Cell) and can be added to a [Table](crate::Table). -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct Row { /// Index of the row. /// This will be set as soon as the row is added to the table. @@ -14,19 +14,9 @@ pub struct Row { pub(crate) max_height: Option, } -impl Default for Row { - fn default() -> Self { - Self::new() - } -} - impl Row { pub fn new() -> Row { - Row { - index: None, - cells: Vec::new(), - max_height: None, - } + Row::default() } /// Add a cell to the row.