Skip to content

Commit

Permalink
derive 'Default' where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Jan 29, 2022
1 parent 5b36ebb commit 4347e3e
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/row.rs
Expand Up @@ -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.
Expand All @@ -14,19 +14,9 @@ pub struct Row {
pub(crate) max_height: Option<usize>,
}

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.
Expand Down

0 comments on commit 4347e3e

Please sign in to comment.