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: highest_set_bit.rs
    path of file: ./repos/Rust/src/bit_manipulation
    
    the code of the file until where you have to start completion: // Find Highest Set Bit in Rust
// This code provides a function to calculate the position (or index) of the most significant bit set to 1 in a given integer.

// Define a function to find the highest set bit.
pub fn find_highest_set_bit(num: i32) -> Option<i32> {
    if num < 0 {
   
    
pub fn find_highest_set_bit(num: i32) -> Option<i32> {
    if num < 0 {
        // Input cannot be negative.
        panic!("Input cannot be negative");
    }

    if num == 0 {
        return None; // No bit is set, return None.
    }

    let mut position = 0;
    let mut n = num;

    while n > 0 {
        n >>= 1;
        position += 1;
    }

    Some(position - 1)
}