Skip to content

Commit f6002ab

Browse files
author
bors-servo
authored
Auto merge of rust-lang#989 - aeleos:master, r=fitzgen
Make whitelisted_var consistant with CLI flags Closes rust-lang#986 This is my first time contributing to rust so hopefully I did everything right, otherwise let me know.
2 parents b349cf7 + 2c86445 commit f6002ab

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,20 @@ impl Builder {
651651
/// Whitelist the given variable so that it (and all types that it
652652
/// transitively refers to) appears in the generated bindings. Regular
653653
/// expressions are supported.
654-
pub fn whitelisted_var<T: AsRef<str>>(mut self, arg: T) -> Builder {
654+
pub fn whitelist_var<T: AsRef<str>>(mut self, arg: T) -> Builder {
655655
self.options.whitelisted_vars.insert(arg);
656656
self
657657
}
658658

659+
/// Whitelist the given variable.
660+
///
661+
/// Deprecated: use whitelist_var instead.
662+
#[deprecated = "use whitelist_var instead"]
663+
pub fn whitelisted_var<T: AsRef<str>>(self, arg: T) -> Builder {
664+
self.whitelist_var(arg)
665+
}
666+
667+
659668
/// Mark the given enum (or set of enums, if using a pattern) as being
660669
/// bitfield-like. Regular expressions are supported.
661670
///

src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ where
485485

486486
if let Some(whitelist) = matches.values_of("whitelist-var") {
487487
for regex in whitelist {
488-
builder = builder.whitelisted_var(regex);
488+
builder = builder.whitelist_var(regex);
489489
}
490490
}
491491

0 commit comments

Comments
 (0)