mural 0.1.0

Conversational terminal rendering for command-line applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{Line, Span, Style};

pub(super) fn empty_lines(count: usize) -> impl Iterator<Item = Line> {
    std::iter::repeat_with(|| Line::from_spans(Vec::new())).take(count)
}

pub(super) fn push_spaces(spans: &mut Vec<Span>, width: usize) {
    if width == 0 {
        return;
    }

    spans.push(Span::from_trusted_content(" ".repeat(width), Style::new()));
}