From 2c16183f30d94e6d8c713a47e3f4fa3cf161d79e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 4 Feb 2024 12:55:49 +0000 Subject: [PATCH] Add Default impls (prompted by clippy) --- src/text.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/text.rs b/src/text.rs index 05eb8ae..af33780 100644 --- a/src/text.rs +++ b/src/text.rs @@ -215,11 +215,12 @@ impl TextFragment for Vec { } } +#[derive(Default)] pub struct BlankLine {} impl BlankLine { pub fn new() -> Self { - BlankLine {} + Self::default() } pub fn render_static() -> Vec { @@ -333,11 +334,12 @@ fn test_separator() { ); } +#[derive(Default)] pub struct EditorHeaderSeparator {} impl EditorHeaderSeparator { pub fn new() -> Self { - EditorHeaderSeparator {} + Self::default() } } @@ -474,6 +476,12 @@ pub struct Paragraph { centred: bool, } +impl Default for Paragraph { + fn default() -> Self { + Self::new() + } +} + impl Paragraph { pub fn new() -> Self { Paragraph { -- 2.30.2