Skip to content

Commit

Permalink
fix: formatting in src/ and tests/ directories
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal committed Sep 21, 2024
1 parent 1fd9656 commit f9add3e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/book/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(|| {
Expand Down
7 changes: 2 additions & 5 deletions src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 1 addition & 3 deletions tests/alternative_backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit f9add3e

Please sign in to comment.