refactor: refactor

This commit is contained in:
graelo 2020-05-29 16:23:46 +02:00
parent 01d6e62689
commit 1ea1af7bdd
4 changed files with 79 additions and 30 deletions

View file

@ -24,6 +24,7 @@ pub fn run(buffer: String, opt: &CliOpt) -> Vec<(String, bool)> {
let hint_style = match &opt.hint_style {
None => None,
Some(style) => match style {
HintStyleCli::Bold => Some(view::HintStyle::Bold),
HintStyleCli::Italic => Some(view::HintStyle::Italic),
HintStyleCli::Underline => Some(view::HintStyle::Underline),
HintStyleCli::Surround => {
@ -117,6 +118,7 @@ pub struct CliOpt {
/// as we cannot directly parse into view::HintStyle.
#[derive(Debug, Clap)]
enum HintStyleCli {
Bold,
Italic,
Underline,
Surround,