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: _1624_largest_substring_between_two_equal_characters.rs
    path of file: ./repos/rustgym/leetcode/src/d16
    
    the code of the file until where you have to start completion: struct Solution;

use std::collections::HashMap;

impl Solution {
    fn max_length_between_equal_characters(s: String) -> i32 {
        let mut hm: HashMap<char
    
    fn max_length_between_equal_characters(s: String) -> i32 {
        let mut hm: HashMap<char, usize> = HashMap::new();
        let mut max = std::usize::MIN;
        for (i, c) in s.char_indices() {
            if let Some(j) = hm.get(&c) {
                max = max.max(i - j);
            }
            hm.entry(c).or_insert(i);
        }
        if max > 0 {
            max as i32 - 1
        } else {
            -1
        }
    }