@@ -81,6 +81,7 @@ macro_rules! iter_impl {
81
81
/// `From` implementation for `BitIter`.
82
82
impl From <$t> for BitIter <$t> {
83
83
/// Construct a BitIter value.
84
+ #[ inline]
84
85
fn from( value: $t) -> Self {
85
86
Self ( value)
86
87
}
@@ -90,6 +91,7 @@ macro_rules! iter_impl {
90
91
impl Iterator for BitIter <$t> {
91
92
type Item = usize ;
92
93
94
+ #[ inline]
93
95
fn next( & mut self ) -> Option <Self :: Item > {
94
96
if self . 0 != 0 {
95
97
let trailing = self . 0 . trailing_zeros( ) as usize ;
@@ -100,15 +102,18 @@ macro_rules! iter_impl {
100
102
}
101
103
}
102
104
105
+ #[ inline]
103
106
fn size_hint( & self ) -> ( usize , Option <usize >) {
104
107
let sz = self . 0 . count_ones( ) as usize ;
105
108
( sz, Some ( sz) )
106
109
}
107
110
111
+ #[ inline]
108
112
fn count( self ) -> usize {
109
113
self . 0 . count_ones( ) as usize
110
114
}
111
115
116
+ #[ inline]
112
117
fn last( self ) -> Option <Self :: Item > {
113
118
if self . 0 != 0 {
114
119
Some ( 8 * size_of:: <$t>( ) - 1 - self . 0 . leading_zeros( ) as usize )
@@ -117,6 +122,7 @@ macro_rules! iter_impl {
117
122
}
118
123
}
119
124
125
+ #[ inline]
120
126
fn nth( & mut self , n: usize ) -> Option <Self :: Item > {
121
127
let mut i = 0 ;
122
128
while self . 0 != 0 && i < n {
@@ -126,10 +132,12 @@ macro_rules! iter_impl {
126
132
self . next( )
127
133
}
128
134
135
+ #[ inline]
129
136
fn max( self ) -> Option <Self :: Item > {
130
137
self . last( )
131
138
}
132
139
140
+ #[ inline]
133
141
fn min( self ) -> Option <Self :: Item > {
134
142
if self . 0 != 0 {
135
143
Some ( self . 0 . trailing_zeros( ) as usize )
@@ -144,6 +152,7 @@ macro_rules! iter_impl {
144
152
145
153
/// `DoubleEndedIterator` implementation for `BitIter`.
146
154
impl DoubleEndedIterator for BitIter <$t> {
155
+ #[ inline]
147
156
fn next_back( & mut self ) -> Option <Self :: Item > {
148
157
if self . 0 != 0 {
149
158
let highest = 8 * size_of:: <$t>( ) - 1 - self . 0 . leading_zeros( ) as usize ;
0 commit comments