/// Finds an existing allocation that overlaps the given offset inside
/// `self`.
///
/// Returns the index into `self.allocations`.
Finds an existing allocation that overlaps the given offset inside
`self`.

Returns the index into `self.allocations`.
Finds an existing allocation that overlaps the given offset inside ` self ` . Returns the index into ` self . allocations ` .
fn find_allocation_overlapping(&self, offset: usize) -> Result<usize, usize> {
        use std::cmp::Ordering;
        self.list.binary_search_by(|alloc| {
            if alloc.end <= offset {
                Ordering::Less
            } else if alloc.start > offset {
                Ordering::Greater
            } else {
                assert!(alloc.start <= offset && alloc.end > offset);
                Ordering::Equal
            }
        })
    }
fn find_allocation_overlapping ( & self , offset : usize ) -> Result < usize , usize > { use std :: cmp :: Ordering ; self . list . binary_search_by ( | alloc | { if alloc . end <= offset { Ordering :: Less } else if alloc . start > offset { Ordering :: Greater } else { assert ! ( alloc start offset alloc end offset ) ; Ordering :: Equal } } ) }
Finds an existing allocation that overlaps the given offset inside
`self`.
Finds an existing allocation that overlaps the given offset inside ` self ` .
&self
offset
usize