@@ -6,6 +6,7 @@ use crate::{
66};
77use helix_view::graphics::{Rect, Style};
88
9+/// Border render type. Defaults to [`BorderType::Plain`].
910#[derive(Debug, Clone, Copy, PartialEq)]
1011pub enum BorderType {
1112 Plain,
@@ -25,6 +26,12 @@ impl BorderType {
2526 }
2627}
2728
29+impl Default for BorderType {
30+ fn default() -> BorderType {
31+ BorderType::Plain
32+ }
33+}
34+
2835/// Base widget to be used with all upper level ones. It may be used to display a box border around
2936/// the widget and/or add a title.
3037///
@@ -40,7 +47,7 @@ impl BorderType {
4047/// .border_type(BorderType::Rounded)
4148/// .style(Style::default().bg(Color::Black));
4249/// ```
43−#[derive(Debug, Clone, PartialEq)]
50+#[derive(Debug, Default, Clone, PartialEq)]
4451pub struct Block<'a> {
4552 /// Optional title place on the upper left of the block
4653 title: Option<Spans<'a>>,
@@ -55,18 +62,6 @@ pub struct Block<'a> {
5562 style: Style,
5663}
5764
58−impl<'a> Default for Block<'a> {
59− fn default() -> Block<'a> {
60− Block {
61− title: None,
62− borders: Borders::NONE,
63− border_style: Default::default(),
64− border_type: BorderType::Plain,
65− style: Default::default(),
66− }
67− }
68−}
69−
7065impl<'a> Block<'a> {
7166 pub fn title<T>(mut self, title: T) -> Block<'a>
7267 where