aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/text.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-02-13 09:31:51 +0000
committerBlaž Hrastnik2022-02-13 09:31:51 +0000
commitbd549d8a20cce98e24c8653a4a86107c786cbaa3 (patch)
tree0780b58d41b6181e69023265cdb54517e2953778 /helix-tui/src/text.rs
parent7ad8eaaef0b292f4be6c66298cea40d2b928e172 (diff)
parent7083b98a388b30e0b61caac9bf6ccc1d79eadf81 (diff)
Merge remote-tracking branch 'origin/master' into debug
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.
///