Skip to content

Commit

Permalink
Change: Use helper
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Aug 27, 2023
1 parent 05d7035 commit 19db2a4
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/bindgen/ir/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,12 @@ impl Source for Function {
}
}
if let Some(note) = func.annotations.deprecated_note(config) {
if note.is_empty() {
if let Some(ref anno) = config.function.deprecated {
write!(out, "{}", anno);
out.new_line();
}
} else if let Some(ref anno) = config.function.deprecated_with_note {
write!(
out,
"{}",
anno.replace("{}", format!("{:?}", note).as_str())
);
if let Some(note) = func.annotations.format_deprecated_note(
config.function.deprecated.as_deref(),
config.function.deprecated_with_note.as_deref(),
note,
) {
write!(out, "{}", note);
out.new_line();
}
}
Expand Down

0 comments on commit 19db2a4

Please sign in to comment.