Skip to content

Commit 4e02320

Browse files
committed
Make BindgenOptions pub(crate)
1 parent ab6d51b commit 4e02320

File tree

3 files changed

+6
-35
lines changed

3 files changed

+6
-35
lines changed

src/ir/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn find_effective_target(clang_args: &[String]) -> (String, bool) {
321321

322322
impl BindgenContext {
323323
/// Construct the context for the given `options`.
324-
pub fn new(options: BindgenOptions) -> Self {
324+
pub(crate) fn new(options: BindgenOptions) -> Self {
325325
use clang_sys;
326326

327327
// TODO(emilio): Use the CXTargetInfo here when available.
@@ -1795,7 +1795,7 @@ impl BindgenContext {
17951795
}
17961796

17971797
/// Get the options used to configure this bindgen context.
1798-
pub fn options(&self) -> &BindgenOptions {
1798+
pub(crate) fn options(&self) -> &BindgenOptions {
17991799
&self.options
18001800
}
18011801

src/lib.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
#![deny(missing_docs)]
88
#![deny(warnings)]
99
#![deny(unused_extern_crates)]
10-
// We internally use the deprecated BindgenOptions all over the place. Once we
11-
// remove its `pub` declaration, we can un-deprecate it and remove this pragma.
12-
#![allow(deprecated)]
1310
// To avoid rather annoying warnings when matching with CXCursor_xxx as a
1411
// constant.
1512
#![allow(non_upper_case_globals)]
@@ -1101,11 +1098,8 @@ impl Builder {
11011098
}
11021099

11031100
/// Configuration options for generated bindings.
1104-
///
1105-
/// Deprecated: use a `Builder` instead.
11061101
#[derive(Debug)]
1107-
#[deprecated]
1108-
pub struct BindgenOptions {
1102+
pub(crate) struct BindgenOptions {
11091103
/// The set of types that have been blacklisted and should not appear
11101104
/// anywhere in the generated code.
11111105
pub blacklisted_types: RegexSet,
@@ -1299,11 +1293,6 @@ impl BindgenOptions {
12991293
self.rust_features = rust_target.into();
13001294
}
13011295

1302-
/// Get target Rust version
1303-
pub fn rust_target(&self) -> RustTarget {
1304-
self.rust_target
1305-
}
1306-
13071296
/// Get features supported by target Rust version
13081297
pub fn rust_features(&self) -> RustFeatures {
13091298
self.rust_features
@@ -1408,10 +1397,7 @@ pub struct Bindings {
14081397

14091398
impl Bindings {
14101399
/// Generate bindings for the given options.
1411-
///
1412-
/// Deprecated - use a `Builder` instead
1413-
#[deprecated]
1414-
pub fn generate(
1400+
pub(crate) fn generate(
14151401
mut options: BindgenOptions,
14161402
) -> Result<Bindings, ()> {
14171403
ensure_libclang_is_loaded();
@@ -1737,8 +1723,8 @@ fn commandline_flag_unit_test_function() {
17371723
//Test 2
17381724
let bindings = ::builder()
17391725
.header("input_header")
1740-
.whitelisted_type("Distinct_Type")
1741-
.whitelisted_function("safe_function");
1726+
.whitelist_type("Distinct_Type")
1727+
.whitelist_function("safe_function");
17421728

17431729
let command_line_flags = bindings.command_line_flags();
17441730
let test_cases = vec![

src/regex_set.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ impl RegexSet {
1818
self.items.is_empty()
1919
}
2020

21-
/// Extend this set with every regex in the iterator.
22-
pub fn extend<I, S>(&mut self, iter: I)
23-
where
24-
I: IntoIterator<Item = S>,
25-
S: AsRef<str>,
26-
{
27-
for s in iter.into_iter() {
28-
self.insert(s)
29-
}
30-
}
31-
3221
/// Insert a new regex into this set.
3322
pub fn insert<S>(&mut self, string: S)
3423
where
@@ -42,10 +31,6 @@ impl RegexSet {
4231
pub fn get_items(&self) -> &[String] {
4332
&self.items[..]
4433
}
45-
/// Returns reference of its field 'set'
46-
pub fn get_set(&self) -> Option<&RxSet> {
47-
self.set.as_ref()
48-
}
4934

5035
/// Construct a RegexSet from the set of entries we've accumulated.
5136
///

0 commit comments

Comments
 (0)