File tree Expand file tree Collapse file tree 4 files changed +19
-29
lines changed Expand file tree Collapse file tree 4 files changed +19
-29
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ shlex = "0.1"
47
47
[dependencies ]
48
48
bitflags = " 1.0.3"
49
49
cexpr = " 0.4"
50
- cfg-if = " 1"
51
50
# This kinda sucks: https://github.com/rust-lang/cargo/issues/1982
52
51
clap = { version = " 2" , optional = true }
53
52
clang-sys = { version = " 1" , features = [" clang_6_0" ] }
Original file line number Diff line number Diff line change @@ -101,24 +101,23 @@ pub trait ItemAncestors {
101
101
fn ancestors < ' a > ( & self , ctx : & ' a BindgenContext ) -> ItemAncestorsIter < ' a > ;
102
102
}
103
103
104
- cfg_if ! {
105
- if #[ cfg( testing_only_extra_assertions) ] {
106
- type DebugOnlyItemSet = ItemSet ;
107
- } else {
108
- struct DebugOnlyItemSet ;
109
-
110
- impl DebugOnlyItemSet {
111
- fn new( ) -> Self {
112
- DebugOnlyItemSet
113
- }
104
+ #[ cfg( testing_only_extra_assertions) ]
105
+ type DebugOnlyItemSet = ItemSet ;
114
106
115
- fn contains( & self , _id: & ItemId ) -> bool {
116
- false
117
- }
107
+ #[ cfg( not( testing_only_extra_assertions) ) ]
108
+ struct DebugOnlyItemSet ;
118
109
119
- fn insert( & mut self , _id: ItemId ) { }
120
- }
110
+ #[ cfg( not( testing_only_extra_assertions) ) ]
111
+ impl DebugOnlyItemSet {
112
+ fn new ( ) -> Self {
113
+ DebugOnlyItemSet
121
114
}
115
+
116
+ fn contains ( & self , _id : & ItemId ) -> bool {
117
+ false
118
+ }
119
+
120
+ fn insert ( & mut self , _id : ItemId ) { }
122
121
}
123
122
124
123
/// An iterator over an item and its ancestors.
@@ -132,7 +131,7 @@ impl<'a> ItemAncestorsIter<'a> {
132
131
fn new < Id : Into < ItemId > > ( ctx : & ' a BindgenContext , id : Id ) -> Self {
133
132
ItemAncestorsIter {
134
133
item : id. into ( ) ,
135
- ctx : ctx ,
134
+ ctx,
136
135
seen : DebugOnlyItemSet :: new ( ) ,
137
136
}
138
137
}
Original file line number Diff line number Diff line change 18
18
#[ macro_use]
19
19
extern crate bitflags;
20
20
#[ macro_use]
21
- #[ allow( unused_extern_crates) ]
22
- extern crate cfg_if;
23
- #[ macro_use]
24
21
extern crate lazy_static;
25
22
#[ macro_use]
26
23
extern crate quote;
@@ -44,14 +41,10 @@ mod extra_assertions;
44
41
// we don't expose internals to library consumers.
45
42
macro_rules! doc_mod {
46
43
( $m: ident, $doc_mod_name: ident) => {
47
- cfg_if! {
48
- if #[ cfg( feature = "testing_only_docs" ) ] {
49
- pub mod $doc_mod_name {
50
- //! Autogenerated documentation module.
51
- pub use super :: $m:: * ;
52
- }
53
- } else {
54
- }
44
+ #[ cfg( feature = "testing_only_docs" ) ]
45
+ pub mod $doc_mod_name {
46
+ //! Autogenerated documentation module.
47
+ pub use super :: $m:: * ;
55
48
}
56
49
} ;
57
50
}
You can’t perform that action at this time.
0 commit comments