Turn chained if's into match

This commit is contained in:
Jaime Valdemoros 2018-01-16 22:33:09 +00:00
parent f2d7b705af
commit 90fa1b4909
1 changed files with 5 additions and 4 deletions

View File

@ -350,10 +350,11 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<Preprocessor>>> {
let mut preprocessors: Vec<Box<Preprocessor>> = Vec::new(); let mut preprocessors: Vec<Box<Preprocessor>> = Vec::new();
for key in preprocess_list { for key in preprocess_list {
if key == "links" { match key.as_ref() {
"links" => {
preprocessors.push(Box::new(LinkPreprocessor::new())) preprocessors.push(Box::new(LinkPreprocessor::new()))
} else { }
bail!("{:?} is not a recognised preprocessor", key); _ => bail!("{:?} is not a recognised preprocessor", key),
} }
} }