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: perfect_square.rs
    path of file: ./repos/Rust/src/math
    
    the code of the file until where you have to start completion: // Author : cyrixninja
// Perfect Square : Checks if a number is perfect square number or not
// https://en.wikipedia.org/wiki/Perfect_square
pu
    
pub fn perfect_square_binary_search(n: i32) -> bool {
    if n < 0 {
        return false;
    }

    let mut left = 0;
    let mut right = n;

    while left <= right {
        let mid = (left + right) / 2;
        let mid_squared = mid * mid;

        match mid_squared.cmp(&n) {
            std::cmp::Ordering::Equal => return true,
            std::cmp::Ordering::Greater => right = mid - 1,
            std::cmp::Ordering::Less => left = mid + 1,
        }
    }

    false
}