@@ -137,51 +137,51 @@ impl<H, T> HeaderVec<H, T> {
137
137
/// Get the length of the vector from a mutable reference. When one has a `&mut
138
138
/// HeaderVec`, this is the method is always exact and can be slightly faster than the non
139
139
/// mutable `len()`.
140
- #[ cfg( feature = "atomic_append" ) ]
141
- #[ mutants:: skip]
142
- #[ inline( always) ]
143
- pub fn len_exact ( & mut self ) -> usize {
144
- * self . header_mut ( ) . len . get_mut ( )
145
- }
146
- #[ cfg( not( feature = "atomic_append" ) ) ]
147
140
#[ mutants:: skip]
148
141
#[ inline( always) ]
149
142
pub fn len_exact ( & mut self ) -> usize {
150
- self . header_mut ( ) . len
143
+ #[ cfg( feature = "atomic_append" ) ]
144
+ {
145
+ * self . header_mut ( ) . len . get_mut ( )
146
+ }
147
+ #[ cfg( not( feature = "atomic_append" ) ) ]
148
+ {
149
+ self . header_mut ( ) . len
150
+ }
151
151
}
152
152
153
153
/// This gives the length of the `HeaderVec`. This is the non synchronized variant may
154
154
/// produce racy results in case another thread atomically appended to
155
155
/// `&self`. Nevertheless it is always safe to use.
156
- #[ cfg( feature = "atomic_append" ) ]
157
- #[ mutants:: skip]
158
- #[ inline( always) ]
159
- pub fn len ( & self ) -> usize {
160
- self . len_atomic_relaxed ( )
161
- }
162
- #[ cfg( not( feature = "atomic_append" ) ) ]
163
156
#[ mutants:: skip]
164
157
#[ inline( always) ]
165
158
pub fn len ( & self ) -> usize {
166
- self . header ( ) . len
159
+ #[ cfg( feature = "atomic_append" ) ]
160
+ {
161
+ self . len_atomic_relaxed ( )
162
+ }
163
+ #[ cfg( not( feature = "atomic_append" ) ) ]
164
+ {
165
+ self . header ( ) . len
166
+ }
167
167
}
168
168
169
169
/// This gives the length of the `HeaderVec`. With `atomic_append` enabled this gives a
170
170
/// exact result *after* another thread atomically appended to this `HeaderVec`. It still
171
171
/// requires synchronization because the length may become invalidated when another thread
172
172
/// atomically appends data to this `HeaderVec` while we still work with the result of
173
173
/// this method.
174
- #[ cfg( not( feature = "atomic_append" ) ) ]
175
- #[ mutants:: skip]
176
- #[ inline( always) ]
177
- pub fn len_strict ( & self ) -> usize {
178
- self . header ( ) . len
179
- }
180
- #[ cfg( feature = "atomic_append" ) ]
181
174
#[ mutants:: skip]
182
175
#[ inline( always) ]
183
176
pub fn len_strict ( & self ) -> usize {
184
- self . len_atomic_acquire ( )
177
+ #[ cfg( not( feature = "atomic_append" ) ) ]
178
+ {
179
+ self . header ( ) . len
180
+ }
181
+ #[ cfg( feature = "atomic_append" ) ]
182
+ {
183
+ self . len_atomic_acquire ( )
184
+ }
185
185
}
186
186
187
187
/// Check whenever a `HeaderVec` is empty. This uses a `&mut self` reference and is
0 commit comments