Skip to content

Commit 36262fd

Browse files
committed
Clarify main.rs
Print at the correct place and use crate prefixes
1 parent 002ec3e commit 36262fd

File tree

1 file changed

+4
-9
lines changed
  • compiler-rs/clients_schema_to_rest_api_spec/src

1 file changed

+4
-9
lines changed

compiler-rs/clients_schema_to_rest_api_spec/src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use argh::FromArgs;
22
use clients_schema::IndexedModel;
33
use clients_schema_to_rest_api_spec::convert_schema_to_individual_files;
4-
use std::fs::{create_dir_all, File};
4+
use std::fs;
55
use tracing::Level;
66
use tracing_subscriber::fmt::format::FmtSpan;
77
use tracing_subscriber::FmtSubscriber;
@@ -36,22 +36,17 @@ fn main() -> anyhow::Result<()> {
3636
tracing::subscriber::set_global_default(subscriber)?;
3737

3838
tracing::info!("Reading schema from {}", cli.input);
39-
40-
// Read and parse the input schema
41-
let input_file = File::open(&cli.input)?;
39+
let input_file = fs::File::open(&cli.input)?;
4240
let indexed_model: IndexedModel = serde_json::from_reader(input_file)?;
4341

4442
tracing::info!("Converting schema to rest-api-spec format");
4543

4644
// Create output directory if it doesn't exist
47-
create_dir_all(&cli.output_dir)?;
48-
49-
// Convert the schema to individual files
50-
convert_schema_to_individual_files(indexed_model, &cli.output_dir)?;
45+
fs::create_dir_all(&cli.output_dir)?;
5146

5247
tracing::info!("Writing individual API files to {}", cli.output_dir);
48+
convert_schema_to_individual_files(indexed_model, &cli.output_dir)?;
5349

5450
tracing::info!("Conversion completed successfully");
55-
5651
Ok(())
5752
}

0 commit comments

Comments
 (0)