Skip to content

Commit 16cdd2a

Browse files
committed
delete duplicated default logic for --anon-fields-prefix
1 parent 3147afd commit 16cdd2a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bindgen/options/cli.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{
77
regex_set::RegexSet,
88
Abi, AliasVariation, Builder, CodegenConfig, EnumVariation,
99
FieldVisibilityKind, Formatter, MacroTypeVariation, NonCopyUnionStyle,
10-
RustTarget, DEFAULT_ANON_FIELDS_PREFIX,
10+
RustTarget,
1111
};
1212
use clap::{
1313
error::{Error, ErrorKind},
@@ -272,8 +272,8 @@ struct BindgenCommand {
272272
#[arg(long, value_name = "PREFIX")]
273273
ctypes_prefix: Option<String>,
274274
/// Use the given PREFIX for anonymous fields.
275-
#[arg(long, default_value = DEFAULT_ANON_FIELDS_PREFIX, value_name = "PREFIX")]
276-
anon_fields_prefix: String,
275+
#[arg(long, value_name = "PREFIX")]
276+
anon_fields_prefix: Option<String>,
277277
/// Time the different bindgen phases and print to stderr
278278
#[arg(long)]
279279
time_phases: bool,
@@ -848,7 +848,9 @@ where
848848
builder = builder.ctypes_prefix(prefix);
849849
}
850850

851-
builder = builder.anon_fields_prefix(anon_fields_prefix);
851+
if let Some(prefix) = anon_fields_prefix {
852+
builder = builder.anon_fields_prefix(prefix);
853+
}
852854

853855
if let Some(config) = generate {
854856
builder = builder.with_codegen_config(config);

0 commit comments

Comments
 (0)