pub mod parser;
mod types;
use std::borrow::Cow;
use ratatui::text::{Line, Span, Text};
pub use types::{Email, PhoneNumber};
use crate::props::{LineStatic, SpanStatic, TextStatic};
pub fn clone_span<'a, 'b: 'a>(span: &'b Span<'a>) -> SpanStatic {
Span {
content: Cow::Owned(span.content.to_string()),
..*span
}
}
pub fn clone_line<'a, 'b: 'a>(line: &'b Line<'a>) -> LineStatic {
Line {
spans: line.spans.iter().map(clone_span).collect(),
..*line
}
}
pub fn clone_text<'a, 'b: 'a>(text: &'b Text<'a>) -> TextStatic {
Text {
lines: text.lines.iter().map(clone_line).collect(),
..*text
}
}