Skip to content

Commit

Permalink
refactor(lib): pass reference to "generate_code" instead of whole config
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Oct 8, 2023
1 parent 33ea467 commit c0c0b7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ impl GenerationConfig<'_> {
/// Model is returned and not saved to disk yet
pub fn generate_code(
diesel_schema_file_contents: &str,
config: GenerationConfig,
config: &GenerationConfig,
) -> Result<Vec<ParsedTableMacro>> {
parser::parse_and_generate_code(diesel_schema_file_contents, &config)
parser::parse_and_generate_code(diesel_schema_file_contents, config)
}

#[derive(Debug, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -304,7 +304,7 @@ pub fn generate_files(
let generated = generate_code(
&std::fs::read_to_string(input_diesel_schema_file)
.attach_path_err(input_diesel_schema_file)?,
config,
&config,
)?;

if !output_models_dir.exists() {
Expand Down

0 comments on commit c0c0b7c

Please sign in to comment.