chiark / gitweb /
Add Default impls (prompted by clippy)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Feb 2024 12:55:49 +0000 (12:55 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Feb 2024 14:26:16 +0000 (14:26 +0000)
src/text.rs

index 05eb8aef1f1d80e61d55d6db5a25d5f7816851b2..af33780fd9583bcc3d1c34ef28ffc6f789c9d93d 100644 (file)
@@ -215,11 +215,12 @@ impl<T: TextFragment> TextFragment for Vec<T> {
     }
 }
 
+#[derive(Default)]
 pub struct BlankLine {}
 
 impl BlankLine {
     pub fn new() -> Self {
-        BlankLine {}
+        Self::default()
     }
 
     pub fn render_static() -> Vec<ColouredString> {
@@ -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 {