File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -310,13 +310,8 @@ impl Default for DroplessArena {
310
310
impl DroplessArena {
311
311
pub fn in_arena < T : ?Sized > ( & self , ptr : * const T ) -> bool {
312
312
let ptr = ptr as * const u8 as * mut u8 ;
313
- for chunk in & * self . chunks . borrow ( ) {
314
- if chunk. start ( ) <= ptr && ptr < chunk. end ( ) {
315
- return true ;
316
- }
317
- }
318
313
319
- false
314
+ self . chunks . borrow ( ) . iter ( ) . any ( |chunk| chunk . start ( ) <= ptr && ptr < chunk . end ( ) )
320
315
}
321
316
322
317
fn align ( & self , align : usize ) {
@@ -408,7 +403,7 @@ impl DroplessArena {
408
403
{
409
404
assert ! ( !mem:: needs_drop:: <T >( ) ) ;
410
405
assert ! ( mem:: size_of:: <T >( ) != 0 ) ;
411
- assert ! ( slice. len ( ) != 0 ) ;
406
+ assert ! ( ! slice. is_empty ( ) ) ;
412
407
413
408
let mem = self . alloc_raw (
414
409
slice. len ( ) * mem:: size_of :: < T > ( ) ,
You can’t perform that action at this time.
0 commit comments