Extract types into a separate module
This commit is contained in:
parent
806a5bc113
commit
b18a692d46
8 changed files with 57 additions and 32 deletions
|
|
@ -1,25 +0,0 @@
|
|||
#[cfg(feature = "wasm")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[cfg(feature = "wasm")]
|
||||
pub enum History {
|
||||
Unchanged = "Unchanged",
|
||||
AddedFromLeft = "AddedFromLeft",
|
||||
AddedFromRight = "AddedFromRight",
|
||||
RemovedFromLeft = "RemovedFromLeft",
|
||||
RemovedFromRight = "RemovedFromRight",
|
||||
}
|
||||
|
||||
/// Simple enum for describing the result of `reconcile` in a flat list.
|
||||
/// When compiled to WASM, the enum values are the same as their names.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[cfg(not(feature = "wasm"))]
|
||||
pub enum History {
|
||||
Unchanged,
|
||||
AddedFromLeft,
|
||||
AddedFromRight,
|
||||
RemovedFromLeft,
|
||||
RemovedFromRight,
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
use std::fmt::Display;
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Pretty-printable flag to tell which conflicting edit (side)
|
||||
/// an operation is associated with.
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Side {
|
||||
Left,
|
||||
Right,
|
||||
}
|
||||
|
||||
impl Display for Side {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Side::Left => write!(f, "Left"),
|
||||
Side::Right => write!(f, "Right"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue