Rust solution
\nimpl Solution {\n    pub fn digit_sum(s: String, k: i32) -> String {\n        let mut s = s;\n        while s.len() > k as usize {\n            s = s\n       
```\nimpl Solution {\n    pub fn digit_sum(s: String, k: i32) -> String {\n        let mut s = s;\n        while s.len() > k as usize {\n            s = s\n                .chars()\n                .collect::<Vec<_>>()\n                .chunks(k as usize)\n                .map(|chunk| {\n                    chunk\n                        .iter()\n                        .map(|c| c.to_digit(10).unwrap())\n                        .sum::<u32>()\n                        .to_string()\n                })\n                .collect::<Vec<_>>()\n                .join("");\n        }\n        s\n    }\n}\n```
['Rust']