Skip to content

Commit 169adb1

Browse files
author
bors-servo
authored
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.
2 parents f6002ab + f308fbc commit 169adb1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/lib.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,19 @@ impl Builder {
643643
/// Whitelist the given function so that it (and all types that it
644644
/// transitively refers to) appears in the generated bindings. Regular
645645
/// expressions are supported.
646-
pub fn whitelisted_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
646+
pub fn whitelist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
647647
self.options.whitelisted_functions.insert(arg);
648648
self
649649
}
650650

651+
/// Whitelist the given function.
652+
///
653+
/// Deprecated: use whitelist_function instead.
654+
#[deprecated = "use whitelist_function instead"]
655+
pub fn whitelisted_function<T: AsRef<str>>(self, arg: T) -> Builder {
656+
self.whitelist_function(arg)
657+
}
658+
651659
/// Whitelist the given variable so that it (and all types that it
652660
/// transitively refers to) appears in the generated bindings. Regular
653661
/// expressions are supported.

src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ where
473473

474474
if let Some(whitelist) = matches.values_of("whitelist-function") {
475475
for regex in whitelist {
476-
builder = builder.whitelisted_function(regex);
476+
builder = builder.whitelist_function(regex);
477477
}
478478
}
479479

0 commit comments

Comments
 (0)