kvon_rs/indention.rs
1/// The indents used in the encoded string. Can be either a constant amount of
2/// spaces, or a tab.
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum Indention {
5 Tabs,
6 Spaces(usize),
7}
8
9impl std::fmt::Display for Indention {
10 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11 match self {
12 Self::Tabs => write!(f, "tabs"),
13 Self::Spaces(spaces) => write!(f, "spaces:{spaces}"),
14 }
15 }
16}
17
18impl std::default::Default for Indention {
19 fn default() -> Self {
20 Indention::Tabs
21 }
22}