Skip to content

Commit 90fa1b4

Browse files
Turn chained if's into match
1 parent f2d7b70 commit 90fa1b4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/book/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,11 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<Preprocessor>>> {
350350
let mut preprocessors: Vec<Box<Preprocessor>> = Vec::new();
351351

352352
for key in preprocess_list {
353-
if key == "links" {
354-
preprocessors.push(Box::new(LinkPreprocessor::new()))
355-
} else {
356-
bail!("{:?} is not a recognised preprocessor", key);
353+
match key.as_ref() {
354+
"links" => {
355+
preprocessors.push(Box::new(LinkPreprocessor::new()))
356+
}
357+
_ => bail!("{:?} is not a recognised preprocessor", key),
357358
}
358359
}
359360

0 commit comments

Comments
 (0)