1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use super::Record;

/// An immutable, lazily-evalulated GFF line.
pub enum Line {
    /// A directive (`##`).
    Directive(String),
    /// A comment (`#`),
    Comment(String),
    /// A record.
    Record(Record),
}

impl Default for Line {
    fn default() -> Self {
        Self::Comment(String::new())
    }
}

impl From<Line> for String {
    fn from(line: Line) -> Self {
        match line {
            Line::Directive(s) => s,
            Line::Comment(s) => s,
            Line::Record(record) => record.into(),
        }
    }
}