Skip to main content

reconcile_text/types/
side.rs

1use std::fmt::Display;
2
3#[cfg(feature = "serde")]
4use serde::{Deserialize, Serialize};
5
6/// Pretty-printable flag to tell which conflicting edit (side)
7/// an operation is associated with
8#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub enum Side {
11    Left,
12    Right,
13}
14
15impl Display for Side {
16    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17        match self {
18            Side::Left => write!(f, "Left"),
19            Side::Right => write!(f, "Right"),
20        }
21    }
22}