You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: issue-74.rs
    path of file: ./repos/prusti-dev/prusti-tests/tests/verify/fail/gitlab-issues
    
    the code of the file until where you have to start completion: #![allow(unused_comparisons)]

/// Issue #74: "Pure function call fails with insufficient permissions"

// From: https://github.com/xcaptain/rust-algorithms/blob/master/algorithms/src/s
    
pub fn binary_search_iter(arr: VecWrapperusize, target: usize) -> Option<usize> {
    let len = arr.len();
    let mut left = 0;
    let mut right = len - 1;
    let mut result = None;
    let mut done = false;

    let mut condition = left <= right && !done;
    while condition {
        let mid = (left + right) / 2;
        if arr.lookup(mid) < target { //~ ERROR precondition of pure function call might not hold.
            left = mid + 1;
        } else if arr.lookup(mid) > target {
            right = mid - 1;
        } else {
            result = Some(mid);
            done = false;
        }
        condition = left <= right && !done;
    }

    return result;
}