diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-09-14 17:45:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 17:45:15 -0500 |
commit | 169adb111e3e8c6daa4ea42beb938e2e0874c64e (patch) | |
tree | 3c354f612d58495260272219c8adbd012023acd6 | |
parent | f6002ab064bc0690fa69d2a05c94b34bfc6fd2c6 (diff) | |
parent | f308fbcf19b1de0d4cdbf85cafe5c0043c213b38 (diff) |
Auto merge of #990 - treiff:depreciate-whitelisted-function, r=fitzgen
Depreciate whitelisted function.
Closes #985
I also noticed a reference to `whitelisted_function` within the book, should this be updated as well?
https://github.com/rust-lang-nursery/rust-bindgen/blob/a371de097f5e37eb01754525fb1e2029ca88b0be/book/src/whitelisting.md
I've started to learn rust recently, so please let me know if there is anything I missed.
-rw-r--r-- | src/lib.rs | 10 | ||||
-rw-r--r-- | src/options.rs | 2 |
2 files changed, 10 insertions, 2 deletions
@@ -643,11 +643,19 @@ impl Builder { /// Whitelist the given function so that it (and all types that it /// transitively refers to) appears in the generated bindings. Regular /// expressions are supported. - pub fn whitelisted_function<T: AsRef<str>>(mut self, arg: T) -> Builder { + pub fn whitelist_function<T: AsRef<str>>(mut self, arg: T) -> Builder { self.options.whitelisted_functions.insert(arg); self } + /// Whitelist the given function. + /// + /// Deprecated: use whitelist_function instead. + #[deprecated = "use whitelist_function instead"] + pub fn whitelisted_function<T: AsRef<str>>(self, arg: T) -> Builder { + self.whitelist_function(arg) + } + /// Whitelist the given variable so that it (and all types that it /// transitively refers to) appears in the generated bindings. Regular /// expressions are supported. diff --git a/src/options.rs b/src/options.rs index 30c10157..e9fab3cc 100644 --- a/src/options.rs +++ b/src/options.rs @@ -473,7 +473,7 @@ where if let Some(whitelist) = matches.values_of("whitelist-function") { for regex in whitelist { - builder = builder.whitelisted_function(regex); + builder = builder.whitelist_function(regex); } } |