summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-09-15 11:33:20 -0500
committerGitHub <noreply@github.com>2017-09-15 11:33:20 -0500
commitab6d51bb431665b53ec0c0d2370cd1f3d0e372f6 (patch)
tree9c9ab1861bf6f2612ce15384937bb5b2e30b8c51
parent80eff064f1d59e174a7b114a6ef8e204f24492e7 (diff)
parenta68ab1cf22f443a962bf053e282bf761e3d339bd (diff)
Auto merge of #994 - treiff:depreciate-builder-whitelist-type, r=fitzgen
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.
-rw-r--r--src/lib.rs10
-rw-r--r--src/options.rs4
2 files changed, 11 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 757a8a7a..b12f02d1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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
}
diff --git a/src/options.rs b/src/options.rs
index e9fab3cc..9ebedc5d 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -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);
}
}
@@ -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);
}
}