Skip to content

Commit

Permalink
Added 'new' function to C backend Converter
Browse files Browse the repository at this point in the history
  • Loading branch information
Pspritechologist committed Nov 25, 2024
1 parent 95f85b7 commit faeed09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions crates/backend_c/src/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ pub struct Converter {
pub(crate) config: Config,
}

impl Converter {
pub fn new(config: Config) -> Self {
Self {
config
}
}
}

/// Converts Interoptopus types to C types.
pub trait CTypeConverter {
fn config(&self) -> &Config;
Expand Down
2 changes: 1 addition & 1 deletion crates/backend_c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl Generator {
Self {
config: config.clone(),
inventory,
converter: Converter { config },
converter: Converter::new(config),
}
}
}
Expand Down

0 comments on commit faeed09

Please sign in to comment.