4c8c9f6c8a
Co-authored-by: Micha de Vries <micha@devrie.sh>
25 lines
600 B
Rust
25 lines
600 B
Rust
use revision::revisioned;
|
|
use serde::{Deserialize, Serialize};
|
|
use std::fmt::{Display, Formatter, Result};
|
|
|
|
#[revisioned(revision = 1)]
|
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
|
|
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
|
#[non_exhaustive]
|
|
pub enum With {
|
|
NoIndex,
|
|
Index(Vec<String>),
|
|
}
|
|
|
|
impl Display for With {
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
f.write_str("WITH")?;
|
|
match self {
|
|
With::NoIndex => f.write_str(" NOINDEX"),
|
|
With::Index(i) => {
|
|
f.write_str(" INDEX ")?;
|
|
f.write_str(&i.join(","))
|
|
}
|
|
}
|
|
}
|
|
}
|