fix: formatting in src/ and tests/ directories
This commit is contained in:
parent
1fd9656291
commit
f9add3e936
3 changed files with 4 additions and 11 deletions
|
|
@ -508,9 +508,7 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<dyn Preprocessor>>
|
||||||
|
|
||||||
if let Some(after) = table.get("after") {
|
if let Some(after) = table.get("after") {
|
||||||
let after = after.as_array().ok_or_else(|| {
|
let after = after.as_array().ok_or_else(|| {
|
||||||
Error::msg(format!(
|
Error::msg(format!("Expected preprocessor.{name}.after to be an array"))
|
||||||
"Expected preprocessor.{name}.after to be an array"
|
|
||||||
))
|
|
||||||
})?;
|
})?;
|
||||||
for before in after {
|
for before in after {
|
||||||
let before = before.as_str().ok_or_else(|| {
|
let before = before.as_str().ok_or_else(|| {
|
||||||
|
|
|
||||||
|
|
@ -856,9 +856,7 @@ fn fix_code_blocks(html: &str) -> String {
|
||||||
let classes = &caps[2].replace(',', " ");
|
let classes = &caps[2].replace(',', " ");
|
||||||
let after = &caps[3];
|
let after = &caps[3];
|
||||||
|
|
||||||
format!(
|
format!(r#"<code{before}class="{classes}"{after}>"#)
|
||||||
r#"<code{before}class="{classes}"{after}>"#
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
.into_owned()
|
.into_owned()
|
||||||
}
|
}
|
||||||
|
|
@ -916,8 +914,7 @@ fn add_playground_pre(
|
||||||
// we need to inject our own main
|
// we need to inject our own main
|
||||||
let (attrs, code) = partition_source(code);
|
let (attrs, code) = partition_source(code);
|
||||||
|
|
||||||
format!("# #![allow(unused)]\n{attrs}#fn main() {{\n{code}#}}")
|
format!("# #![allow(unused)]\n{attrs}#fn main() {{\n{code}#}}").into()
|
||||||
.into()
|
|
||||||
};
|
};
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,9 +121,7 @@ fn dummy_book_with_backend(
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
if backend_is_optional {
|
if backend_is_optional {
|
||||||
config
|
config.set(format!("output.{name}.optional"), true).unwrap();
|
||||||
.set(format!("output.{name}.optional"), true)
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let md = MDBook::init(temp.path())
|
let md = MDBook::init(temp.path())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue