dfmt/values/alignment.rs
1use core::fmt::Write;
2
3/// Alignment variants of the specifier.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum Alignment {
6 Left,
7 Center,
8 Right,
9 Auto,
10}
11
12impl core::fmt::Display for Alignment {
13 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14 match self {
15 Alignment::Left => f.write_char('<'),
16 Alignment::Center => f.write_char('^'),
17 Alignment::Right => f.write_char('>'),
18 Alignment::Auto => Ok(()),
19 }
20 }
21}