chore(deps): bump clap to 3.0.0-beta.5

This commit is contained in:
graelo 2021-10-24 09:33:55 +02:00
parent 276d17ce8f
commit 077d16311e
9 changed files with 177 additions and 186 deletions

View file

@ -1,26 +1,9 @@
use clap::Clap;
use std::str::FromStr;
use crate::error::ParseError;
use clap::{ArgEnum, Parser};
/// Describes if, during rendering, a hint should aligned to the leading edge of
/// the matched text, or to its trailing edge.
#[derive(Debug, Clap)]
#[derive(Debug, Clone, ArgEnum, Parser)]
pub enum HintAlignment {
Leading,
Trailing,
}
impl FromStr for HintAlignment {
type Err = ParseError;
fn from_str(s: &str) -> Result<HintAlignment, ParseError> {
match s {
"leading" => Ok(HintAlignment::Leading),
"trailing" => Ok(HintAlignment::Trailing),
_ => Err(ParseError::ExpectedString(String::from(
"leading or trailing",
))),
}
}
}