Skip to content

Commit

Permalink
Do not include docstring if empty
Browse files Browse the repository at this point in the history
Closes #3945
  • Loading branch information
kflansburg committed May 7, 2024
1 parent ad251c0 commit 5f13de2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/backend/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,18 @@ impl ToTokens for ast::ImportType {

let no_deref = self.no_deref;

let doc = if doc_comment.is_empty() {
quote! {}
} else {
quote! {
#[doc = #doc_comment]
}
};

(quote! {
#[automatically_derived]
#(#attrs)*
#[doc = #doc_comment]
#doc
#[repr(transparent)]
#vis struct #rust_name {
obj: #internal_obj
Expand Down

0 comments on commit 5f13de2

Please sign in to comment.