diff --git a/src/compile/common.rs b/src/compile/common.rs index dea2090..001f82b 100644 --- a/src/compile/common.rs +++ b/src/compile/common.rs @@ -2861,11 +2861,11 @@ pub async fn compile_shared( /// /// Handles the full setup — collecting extensions, building the compile context, /// generating the stage prefix and template parameters, computing AWF/MCPG -/// values — and delegates to [`compile_shared`]. The caller supplies: +/// values — and delegates to [`compile_shared`]. The caller supplies: /// /// - `cfg`: target-specific settings (template string, integrity / debug flags). /// - `header_fn`: a function that generates the leading comment block prepended -/// to the compiled YAML. The two template compilers use different header +/// to the compiled YAML. The two template compilers use different header /// layouts, so this lets each compiler keep its own generator while sharing /// all of the boilerplate setup. /// @@ -2927,9 +2927,15 @@ pub async fn compile_template_target( }; let yaml = compile_shared( - input_path, output_path, front_matter, markdown_body, - &extensions, &ctx, config, - ).await?; + input_path, + output_path, + front_matter, + markdown_body, + &extensions, + &ctx, + config, + ) + .await?; let header = header_fn(input_path, output_path, front_matter); Ok(format!("{}{}", header, yaml)) diff --git a/src/compile/job.rs b/src/compile/job.rs index a19f1de..6174488 100644 --- a/src/compile/job.rs +++ b/src/compile/job.rs @@ -14,8 +14,7 @@ use std::path::Path; use super::Compiler; use super::common::{ - compile_template_target, TemplateTargetConfig, - generate_header_comment, + compile_template_target, generate_header_comment, TemplateTargetConfig, }; use super::types::FrontMatter; @@ -52,16 +51,15 @@ impl Compiler for JobCompiler { debug_pipeline, }, generate_job_header, - ).await + ) + .await } } /// Generate the header comment block for job-level templates. fn generate_job_header(input_path: &Path, output_path: &Path, front_matter: &FrontMatter) -> String { let base_header = generate_header_comment(input_path); - let mut lock_path = output_path - .to_string_lossy() - .replace('\\', "/"); + let mut lock_path = output_path.to_string_lossy().replace('\\', "/"); // Strip redundant leading "./" (same normalization as generate_header_comment) while lock_path.starts_with("./") { lock_path = lock_path[2..].to_string(); @@ -102,7 +100,6 @@ fn generate_job_header(input_path: &Path, output_path: &Path, front_matter: &Fro #[cfg(test)] mod tests { - use super::*; use crate::compile::common::generate_stage_prefix; #[test] diff --git a/src/compile/stage.rs b/src/compile/stage.rs index fda341e..ba59a3a 100644 --- a/src/compile/stage.rs +++ b/src/compile/stage.rs @@ -22,8 +22,7 @@ use std::path::Path; use super::Compiler; use super::common::{ - compile_template_target, TemplateTargetConfig, - generate_header_comment, + compile_template_target, generate_header_comment, TemplateTargetConfig, }; use super::types::FrontMatter; @@ -60,16 +59,15 @@ impl Compiler for StageCompiler { debug_pipeline, }, generate_stage_header, - ).await + ) + .await } } /// Generate the header comment block for stage-level templates. fn generate_stage_header(input_path: &Path, output_path: &Path, front_matter: &FrontMatter) -> String { let base_header = generate_header_comment(input_path); - let mut lock_path = output_path - .to_string_lossy() - .replace('\\', "/"); + let mut lock_path = output_path.to_string_lossy().replace('\\', "/"); while lock_path.starts_with("./") { lock_path = lock_path[2..].to_string(); }