mirror of
https://gitee.com/openharmony/third_party_rust_bindgen
synced 2025-03-03 20:27:21 +00:00
Remove cfg-if dependency.
We use it so little that it's not worth it.
This commit is contained in:
parent
01cbe44683
commit
30fb4eccb3
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -35,7 +35,6 @@ version = "0.55.1"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cexpr",
|
||||
"cfg-if 1.0.0",
|
||||
"clang-sys",
|
||||
"clap",
|
||||
"diff",
|
||||
|
@ -47,7 +47,6 @@ shlex = "0.1"
|
||||
[dependencies]
|
||||
bitflags = "1.0.3"
|
||||
cexpr = "0.4"
|
||||
cfg-if = "1"
|
||||
# This kinda sucks: https://github.com/rust-lang/cargo/issues/1982
|
||||
clap = { version = "2", optional = true }
|
||||
clang-sys = { version = "1", features = ["clang_6_0"] }
|
||||
|
@ -101,24 +101,23 @@ pub trait ItemAncestors {
|
||||
fn ancestors<'a>(&self, ctx: &'a BindgenContext) -> ItemAncestorsIter<'a>;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(testing_only_extra_assertions)] {
|
||||
type DebugOnlyItemSet = ItemSet;
|
||||
} else {
|
||||
struct DebugOnlyItemSet;
|
||||
#[cfg(testing_only_extra_assertions)]
|
||||
type DebugOnlyItemSet = ItemSet;
|
||||
|
||||
impl DebugOnlyItemSet {
|
||||
fn new() -> Self {
|
||||
DebugOnlyItemSet
|
||||
}
|
||||
#[cfg(not(testing_only_extra_assertions))]
|
||||
struct DebugOnlyItemSet;
|
||||
|
||||
fn contains(&self, _id: &ItemId) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn insert(&mut self, _id: ItemId) {}
|
||||
}
|
||||
#[cfg(not(testing_only_extra_assertions))]
|
||||
impl DebugOnlyItemSet {
|
||||
fn new() -> Self {
|
||||
DebugOnlyItemSet
|
||||
}
|
||||
|
||||
fn contains(&self, _id: &ItemId) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn insert(&mut self, _id: ItemId) {}
|
||||
}
|
||||
|
||||
/// An iterator over an item and its ancestors.
|
||||
@ -132,7 +131,7 @@ impl<'a> ItemAncestorsIter<'a> {
|
||||
fn new<Id: Into<ItemId>>(ctx: &'a BindgenContext, id: Id) -> Self {
|
||||
ItemAncestorsIter {
|
||||
item: id.into(),
|
||||
ctx: ctx,
|
||||
ctx,
|
||||
seen: DebugOnlyItemSet::new(),
|
||||
}
|
||||
}
|
||||
|
15
src/lib.rs
15
src/lib.rs
@ -18,9 +18,6 @@
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
#[macro_use]
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate cfg_if;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
#[macro_use]
|
||||
extern crate quote;
|
||||
@ -44,14 +41,10 @@ mod extra_assertions;
|
||||
// we don't expose internals to library consumers.
|
||||
macro_rules! doc_mod {
|
||||
($m:ident, $doc_mod_name:ident) => {
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "testing_only_docs")] {
|
||||
pub mod $doc_mod_name {
|
||||
//! Autogenerated documentation module.
|
||||
pub use super::$m::*;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
#[cfg(feature = "testing_only_docs")]
|
||||
pub mod $doc_mod_name {
|
||||
//! Autogenerated documentation module.
|
||||
pub use super::$m::*;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user