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 {
310310impl DroplessArena {
311311 pub fn in_arena < T : ?Sized > ( & self , ptr : * const T ) -> bool {
312312 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- }
318313
319- false
314+ self . chunks . borrow ( ) . iter ( ) . any ( |chunk| chunk . start ( ) <= ptr && ptr < chunk . end ( ) )
320315 }
321316
322317 fn align ( & self , align : usize ) {
@@ -408,7 +403,7 @@ impl DroplessArena {
408403 {
409404 assert ! ( !mem:: needs_drop:: <T >( ) ) ;
410405 assert ! ( mem:: size_of:: <T >( ) != 0 ) ;
411- assert ! ( slice. len ( ) != 0 ) ;
406+ assert ! ( ! slice. is_empty ( ) ) ;
412407
413408 let mem = self . alloc_raw (
414409 slice. len ( ) * mem:: size_of :: < T > ( ) ,
You can’t perform that action at this time.
0 commit comments