summaryrefslogtreecommitdiff
path: root/helix-tui/src/text.rs
diff options
context:
space:
mode:
authorGokul Soumya2021-12-18 03:03:15 +0000
committerGokul Soumya2021-12-18 03:03:15 +0000
commitd4fb1d06333315a3c6e9dc7f0ad8055d91551e3a (patch)
treef43da59eec8b897359b84390b1c7d5b69f3bb169 /helix-tui/src/text.rs
parent016640f4fb6f620df13a2cab15e749d623197a51 (diff)
parent3ef115d4203fab93f7efe4f65d8dd63cc4535b91 (diff)
Merge branch 'master' into cursor-shape-new
Diffstat (limited to 'helix-tui/src/text.rs')
-rw-r--r--helix-tui/src/text.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/helix-tui/src/text.rs b/helix-tui/src/text.rs
index b8e52479..8a974ddb 100644
--- a/helix-tui/src/text.rs
+++ b/helix-tui/src/text.rs
@@ -195,15 +195,9 @@ impl<'a> From<&'a str> for Span<'a> {
}
/// A string composed of clusters of graphemes, each with their own style.
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Default, Clone, PartialEq)]
pub struct Spans<'a>(pub Vec<Span<'a>>);
-impl<'a> Default for Spans<'a> {
- fn default() -> Spans<'a> {
- Spans(Vec::new())
- }
-}
-
impl<'a> Spans<'a> {
/// Returns the width of the underlying string.
///
@@ -280,17 +274,11 @@ impl<'a> From<Spans<'a>> for String {
/// text.extend(Text::styled("Some more lines\nnow with more style!", style));
/// assert_eq!(6, text.height());
/// ```
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Default, Clone, PartialEq)]
pub struct Text<'a> {
pub lines: Vec<Spans<'a>>,
}
-impl<'a> Default for Text<'a> {
- fn default() -> Text<'a> {
- Text { lines: Vec::new() }
- }
-}
-
impl<'a> Text<'a> {
/// Create some text (potentially multiple lines) with no style.
///