Skip to content

Commit 2803d0a

Browse files
committed
cargo fmt
1 parent 97daaed commit 2803d0a

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

contrib/tools/config-docs-generator/src/extract_docs.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ fn generate_rustdoc_json(package: &str) -> Result<serde_json::Value> {
183183

184184
// Generate rustdoc for additional crates that might contain referenced constants
185185
for additional_crate in &additional_crates {
186-
let error_msg = format!(
187-
"Failed to run cargo rustdoc command for {additional_crate}"
188-
);
186+
let error_msg = format!("Failed to run cargo rustdoc command for {additional_crate}");
189187
let output = StdCommand::new("cargo")
190188
.args([
191189
"+nightly",
@@ -207,9 +205,7 @@ fn generate_rustdoc_json(package: &str) -> Result<serde_json::Value> {
207205

208206
if !output.status.success() {
209207
let stderr = String::from_utf8_lossy(&output.stderr);
210-
eprintln!(
211-
"Warning: Failed to generate rustdoc for {additional_crate}: {stderr}"
212-
);
208+
eprintln!("Warning: Failed to generate rustdoc for {additional_crate}: {stderr}");
213209
}
214210
}
215211

contrib/tools/config-docs-generator/src/generate_markdown.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,16 @@ fn main() -> Result<()> {
115115
fs::write(output_path, markdown)
116116
.with_context(|| format!("Failed to write output file: {output_path}"))?;
117117

118-
println!(
119-
"Successfully generated Markdown documentation at {output_path}"
120-
);
118+
println!("Successfully generated Markdown documentation at {output_path}");
121119
Ok(())
122120
}
123121

124122
fn load_section_name_mappings(mappings_file: &str) -> Result<HashMap<String, String>> {
125-
let content = fs::read_to_string(mappings_file).with_context(|| {
126-
format!(
127-
"Failed to read section name mappings file: {mappings_file}"
128-
)
129-
})?;
123+
let content = fs::read_to_string(mappings_file)
124+
.with_context(|| format!("Failed to read section name mappings file: {mappings_file}"))?;
130125

131-
let mappings: HashMap<String, String> = serde_json::from_str(&content).with_context(|| {
132-
format!(
133-
"Failed to parse section name mappings JSON: {mappings_file}"
134-
)
135-
})?;
126+
let mappings: HashMap<String, String> = serde_json::from_str(&content)
127+
.with_context(|| format!("Failed to parse section name mappings JSON: {mappings_file}"))?;
136128

137129
Ok(mappings)
138130
}

0 commit comments

Comments
 (0)