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: 0076-minimum-window-substring.rs
    path of file: ./repos/NeetCode-Solutions/03_Sliding_Window/05_Minimum_Window_Substring
    
    the code of the file until where you have to start completion: /*
Problem: LeetCode 76 - Minimum Window Substring

Key Idea:
The key idea is to use a sliding window approach with two pointers. Maintain a window that covers a substring in the main string and contains all required characters. Move the right pointer to expand the window, and when all characters are included, move the left pointer to minimize the window size while still satisfying the conditions. Keep track of the minimum window size as you iterate through the string.

Approach:
1. Initialize two arrays, `target_freq` and `window_freq`, each of size 128 to represent the frequency of characters in the target string and the current window, respectively. Use ASCII values for indexing.
2. Convert the input strings to byte arrays to work with ASCII values.
3. Initialize variables `left` and `right` representing the start and end 
    
    pub fn min_window(s: String, t: String) -> String {
        let s = s.as_bytes();
        let t = t.as_bytes();
        let mut target_freq = [0; 128];
        let mut window_freq = [0; 128];
        let mut left = 0;
        let mut min_length = usize::MAX;
        let mut start_idx = 0;
        let mut required_chars = 0;

        for &ch in t {
            target_freq[ch as usize] += 1;
            required_chars += 1;
        }

        for (right, &ch) in s.iter().enumerate() {
            window_freq[ch as usize] += 1;
            if window_freq[ch as usize] <= target_freq[ch as usize] {
                required_chars -= 1;
            }

            while required_chars == 0 {
                if right - left + 1 < min_length {
                    min_length = right - left + 1;
                    start_idx = left;
                }

                window_freq[s[left] as usize] -= 1;
                if window_freq[s[left] as usize] < target_freq[s[left] as usize] {
                    required_chars += 1;
                }

                left += 1;
            }
        }

        if min_length == usize::MAX {
            "".to_string()
        } else {
            String::from_utf8(s[start_idx..start_idx + min_length].to_vec()).unwrap()
        }
    }