Skip to main content

dlg/parser/
section.rs

1use std::fmt::Display;
2
3/// Section in dialog
4#[derive(Clone, Eq, Hash, PartialEq, Debug)]
5pub enum Section {
6    /// Initial section. Dialog starts from this
7    Initial,
8    /// Named section in dialog
9    Named(String),
10}
11
12impl Display for Section {
13    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14        match &self {
15            Section::Initial => write!(f, "initial"),
16            Section::Named(name) => write!(f, "#{}", name),
17        }
18    }
19}