From: Ian Jackson Date: Sun, 4 Feb 2024 12:55:49 +0000 (+0000) Subject: Add Default impls (prompted by clippy) X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=2c16183f30d94e6d8c713a47e3f4fa3cf161d79e;p=mastodonochrome.git Add Default impls (prompted by clippy) --- 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 {