diff --git a/src/book/mod.rs b/src/book/mod.rs index bc366e39..374ab9f1 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -350,10 +350,11 @@ fn determine_preprocessors(config: &Config) -> Result>> { let mut preprocessors: Vec> = Vec::new(); for key in preprocess_list { - if key == "links" { - preprocessors.push(Box::new(LinkPreprocessor::new())) - } else { - bail!("{:?} is not a recognised preprocessor", key); + match key.as_ref() { + "links" => { + preprocessors.push(Box::new(LinkPreprocessor::new())) + } + _ => bail!("{:?} is not a recognised preprocessor", key), } }