fix: formatting in src/ and tests/ directories

This commit is contained in:
Hamir Mahal 2024-09-21 15:56:13 -07:00
parent 1fd9656291
commit f9add3e936
No known key found for this signature in database
3 changed files with 4 additions and 11 deletions

View file

@ -508,9 +508,7 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<dyn Preprocessor>>
if let Some(after) = table.get("after") {
let after = after.as_array().ok_or_else(|| {
Error::msg(format!(
"Expected preprocessor.{name}.after to be an array"
))
Error::msg(format!("Expected preprocessor.{name}.after to be an array"))
})?;
for before in after {
let before = before.as_str().ok_or_else(|| {

View file

@ -856,9 +856,7 @@ fn fix_code_blocks(html: &str) -> String {
let classes = &caps[2].replace(',', " ");
let after = &caps[3];
format!(
r#"<code{before}class="{classes}"{after}>"#
)
format!(r#"<code{before}class="{classes}"{after}>"#)
})
.into_owned()
}
@ -916,8 +914,7 @@ fn add_playground_pre(
// we need to inject our own main
let (attrs, code) = partition_source(code);
format!("# #![allow(unused)]\n{attrs}#fn main() {{\n{code}#}}")
.into()
format!("# #![allow(unused)]\n{attrs}#fn main() {{\n{code}#}}").into()
};
content
}

View file

@ -121,9 +121,7 @@ fn dummy_book_with_backend(
.unwrap();
if backend_is_optional {
config
.set(format!("output.{name}.optional"), true)
.unwrap();
config.set(format!("output.{name}.optional"), true).unwrap();
}
let md = MDBook::init(temp.path())