Skip to content

Commit

Permalink
no-bindgen-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Mar 5, 2024
1 parent 1b4833c commit c30f5be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/libs/bindgen/src/rust/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub fn from_reader(reader: &'static metadata::Reader, mut config: std::collectio
writer.implement = config.remove("implement").is_some();
writer.minimal = config.remove("minimal").is_some();
writer.no_inner_attributes = config.remove("no-inner-attributes").is_some();
writer.no_bindgen_comment = config.remove("no-bindgen-comment").is_some();
writer.vtbl = config.remove("vtbl").is_some();

if writer.package && writer.flatten {
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/bindgen/src/rust/try_format.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::io::Write;

pub fn try_format(writer: &super::Writer, tokens: &str) -> String {
let preamble = if writer.package {
let preamble = if writer.no_bindgen_comment {
String::new()
} else {
let name = std::env!("CARGO_PKG_NAME");
Expand Down
2 changes: 2 additions & 0 deletions crates/libs/bindgen/src/rust/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct Writer {
pub package: bool, // default is single file with no cfg - implies !flatten
pub minimal: bool, // strips out enumerators - in future possibly other helpers as well
pub no_inner_attributes: bool, // skips the inner attributes at the start of the file
pub no_bindgen_comment: bool, // skips the bindgen comment at the start of the file
pub vtbl: bool, // include minimal vtbl layout support for interfaces
pub prepend: std::collections::HashMap<metadata::TypeDef, String>,
}
Expand All @@ -36,6 +37,7 @@ impl Writer {
package: false,
minimal: false,
no_inner_attributes: false,
no_bindgen_comment: false,
vtbl: false,
prepend: Default::default(),
}
Expand Down

0 comments on commit c30f5be

Please sign in to comment.