File tree Expand file tree Collapse file tree 2 files changed +7
-19
lines changed
contrib/tools/config-docs-generator/src Expand file tree Collapse file tree 2 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -183,9 +183,7 @@ fn generate_rustdoc_json(package: &str) -> Result<serde_json::Value> {
183
183
184
184
// Generate rustdoc for additional crates that might contain referenced constants
185
185
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}" ) ;
189
187
let output = StdCommand :: new ( "cargo" )
190
188
. args ( [
191
189
"+nightly" ,
@@ -207,9 +205,7 @@ fn generate_rustdoc_json(package: &str) -> Result<serde_json::Value> {
207
205
208
206
if !output. status . success ( ) {
209
207
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}" ) ;
213
209
}
214
210
}
215
211
Original file line number Diff line number Diff line change @@ -115,24 +115,16 @@ fn main() -> Result<()> {
115
115
fs:: write ( output_path, markdown)
116
116
. with_context ( || format ! ( "Failed to write output file: {output_path}" ) ) ?;
117
117
118
- println ! (
119
- "Successfully generated Markdown documentation at {output_path}"
120
- ) ;
118
+ println ! ( "Successfully generated Markdown documentation at {output_path}" ) ;
121
119
Ok ( ( ) )
122
120
}
123
121
124
122
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}" ) ) ?;
130
125
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}" ) ) ?;
136
128
137
129
Ok ( mappings)
138
130
}
You can’t perform that action at this time.
0 commit comments