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: 0300.rs
    path of file: ./repos/Leetcode/src/0300-Longest-Increasing-Subsequence
    
    the code of the file until where you have to start completion: impl Solution {
    pub fn length_of_lis(nums: Vec<i32>) -> i32 {
        let mut tmp = Vec::new();
        for num i
    
    pub fn length_of_lis(nums: Vec<i32>) -> i32 {
        let mut tmp = Vec::new();
        for num in nums.iter() {
            match tmp.binary_search(num) {
                Ok(_) => (),
                Err(idx) => {
                    if let Some(old) = tmp.get_mut(idx) {
                        *old = *num;
                    } else {
                        tmp.push(*num);
                    }
                }
            }
        }
        tmp.len() as i32
    }