rust
\nimpl Solution {\n  pub fn subtract_product_and_sum(n: i32) -> i32 {\n    let string = n.to_string();\n    let digits = string.chars().map(|c| c.to_digit(10).u
```\nimpl Solution {\n  pub fn subtract_product_and_sum(n: i32) -> i32 {\n    let string = n.to_string();\n    let digits = string.chars().map(|c| c.to_digit(10).unwrap() as i32);\n    let product: i32 = digits.clone().product();\n    let sum: i32 = digits.sum();\n    product - sum\n  }\n}\n```
['Rust']