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: 0128-longest-consecutive-sequence.rs
    path of file: ./repos/NeetCode-Solutions/01_Arrays_&_Hashing/09_Longest_Consecutive_Sequence
    
    the code of the file until where you have to start completion: /*
Problem: LeetCode 128 - Longest Consecutive Sequence

Key Idea:
The key idea is to use a hash set to efficiently keep track of the consecutive sequence lengths starting from each number.

Approach:
1. Create a hash set to store the numbers from t
    
    pub fn longest_consecutive(nums: Vec<i32>) -> i32 {
        let num_set: HashSet<i32> = nums.iter().cloned().collect();
        let mut longest_streak: i32 = 0;

        for num in num_set.iter() {
            if !num_set.contains(&(num - 1)) {
                let mut streak = 1;
                let mut current = *num;

                while (num_set.contains(&(current + 1))) {
                    current += 1;
                    streak += 1;
                }

                longest_streak = std::cmp::max(streak, longest_streak);
            }
        }

        longest_streak
    }