Rust (without strings)
\nfn digits(mut n: i32) -> impl Iterator<Item = i32> {\n    std::iter::from_fn(move || {\n        if n <= 0 {\n            None\n        } else {\n            l
```\nfn digits(mut n: i32) -> impl Iterator<Item = i32> {\n    std::iter::from_fn(move || {\n        if n <= 0 {\n            None\n        } else {\n            let digit = n % 10;\n            n = n / 10;\n            Some(digit)\n        }\n    })\n}\n\nimpl Solution {\n    pub fn subtract_product_and_sum(n: i32) -> i32 {\n          digits(n).fold(1, |acc, d| acc * d)\n        - digits(n).fold(0, |acc, d| acc + d)\n    }\n}\n```
[]