use super::*;
ns_do_variety_plain! {}
#[derive(Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(clippy::exhaustive_structs)]
pub struct VarietyKeyword;
const VARIETY_KEYWORD: &str = "ns";
impl ItemArgument for VarietyKeyword {
fn write_arg_onto(&self, out: &mut ItemEncoder<'_>) -> StdResult<(), Bug> {
out.add_arg(&VARIETY_KEYWORD);
Ok(())
}
}
impl ItemArgumentParseable for VarietyKeyword {
fn from_args<'s>(args: &mut ArgumentStream<'s>) -> StdResult<Self, ArgumentError> {
match args.next() {
None => Ok(VarietyKeyword),
Some(s) if s == VARIETY_KEYWORD => Ok(VarietyKeyword),
Some(_other) => Err(ArgumentError::Invalid),
}
}
}