Skip to content

Commit

Permalink
codegen/object: Check for generate_safety_asserts when generating bui…
Browse files Browse the repository at this point in the history
…lders
  • Loading branch information
bilelmoussaoui committed Oct 22, 2024
1 parent d7ce1bd commit 18c5428
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/codegen/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,14 @@ fn generate_builder(w: &mut dyn Write, env: &Env, analysis: &analysis::object::I
pub fn build(self) -> {name} {{",
name = analysis.name,
)?;
writeln!(
w,
"{}",
safety_assertion_mode_to_str(SafetyAssertionMode::InMainThread)
)?;

if env.config.generate_safety_asserts {
writeln!(
w,
"{}",
safety_assertion_mode_to_str(SafetyAssertionMode::InMainThread)
)?;
}

// The split allows us to not have clippy::let_and_return lint disabled
if let Some(code) = analysis.builder_postprocess.as_ref() {
Expand Down

0 comments on commit 18c5428

Please sign in to comment.