Skip to content

Commit

Permalink
Auto merge of #994 - treiff:depreciate-builder-whitelist-type, r=fitzgen
Browse files Browse the repository at this point in the history
Depreciate `Builder::whitelisted_type`.

Closes #987

Also, we were making a call to the now deprecated `Builder::hide_type`,
changed that over to call `Builder::blacklist_type.
  • Loading branch information
bors-servo authored Sep 15, 2017
2 parents 80eff06 + a68ab1c commit ab6d51b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,15 @@ impl Builder {
/// Whitelist the given type so that it (and all types that it transitively
/// refers to) appears in the generated bindings. Regular expressions are
/// supported.
pub fn whitelisted_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
#[deprecated = "use whitelist_type instead"]
pub fn whitelisted_type<T: AsRef<str>>(self, arg: T) -> Builder {
self.whitelist_type(arg)
}

/// Whitelist the given type so that it (and all types that it transitively
/// refers to) appears in the generated bindings. Regular expressions are
/// supported.
pub fn whitelist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.whitelisted_types.insert(arg);
self
}
Expand Down
4 changes: 2 additions & 2 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ where
}
if let Some(hidden_types) = matches.values_of("blacklist-type") {
for ty in hidden_types {
builder = builder.hide_type(ty);
builder = builder.blacklist_type(ty);
}
}

Expand Down Expand Up @@ -479,7 +479,7 @@ where

if let Some(whitelist) = matches.values_of("whitelist-type") {
for regex in whitelist {
builder = builder.whitelisted_type(regex);
builder = builder.whitelist_type(regex);
}
}

Expand Down

0 comments on commit ab6d51b

Please sign in to comment.