Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made definer &mut #141

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/headers/_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ match_! {(
Builder {
target: WhereTo, $(
$field, )*
}.generate_with_definer(HashSetDefiner {
}.generate_with_definer(&mut HashSetDefiner {
out: &mut target,
defines_set: Default::default(),
})
Expand All @@ -325,18 +325,18 @@ impl Builder<'_, WhereTo> {
/// With this call, one can provide a custom implementation of a [`Definer`],
/// which can be useful for mock tests, mainly.
pub
fn generate_with_definer (self, mut definer: impl Definer)
fn generate_with_definer (self, definer: &mut impl Definer)
-> io::Result<()>
{
let config = self;
// Banner
config.write_banner(&mut definer)?;
config.write_banner(definer)?;
// Prelude
config.write_prelude(&mut definer)?;
config.write_prelude(definer)?;
/* User-provided defs! */
config.write_body(&mut definer)?;
config.write_body(definer)?;
// Epilogue
config.write_epilogue(&mut definer)?;
config.write_epilogue(definer)?;
Ok(())
}

Expand Down