[Rust] Clean union find solution
Code\n\nimpl Solution {\n    pub fn smallest_equivalent_string(s1: String, s2: String, base_str: String) -> String {\n        // recursively get the root elemen
# Code\n```\nimpl Solution {\n    pub fn smallest_equivalent_string(s1: String, s2: String, base_str: String) -> String {\n        // recursively get the root element\n        fn get(root: &mut Vec<usize>, x: usize) -> usize {\n            if x == root[x] { return x; }\n            root[x] = get(root, root[x]);\n            root[x]\n        }\n        // unite two elements\n        fn unite(root: &mut Vec<usize>, x: usize, y: usize) {\n            let x = get(root, x);\n            let y = get(root, y);\n            // if their roots are not same, we combine them\n            if x == y { return; } \n            // smaller first\n            if x < y {\n                root[y] = x;\n            } else {\n                root[x] = y;\n            }\n        }\n        let s1 = s1.chars().collect::<Vec<char>>();\n        let s2 = s2.chars().collect::<Vec<char>>();\n        let mut root: Vec<usize> = (0..26).into_iter().collect();\n        for i in 0..s1.len() {\n            let (u, v) = ((s1[i] as u8 - \'a\' as u8) as usize, (s2[i] as u8 - \'a\' as u8) as usize);\n            unite(&mut root, u, v);\n        }\n        let mut res = String::new();\n        for c in base_str.chars() {\n            let k = (c as u8 - \'a\' as u8) as usize;\n            let ch = get(&mut root, k) as u8 + \'a\' as u8;\n            res.push(ch as char);\n        }\n        res\n    }\n}\n```
['Union Find', 'Rust']