[Rust] Average one-liner enjoyer
\n\n# Complexity\n- Time complexity:\nO(m \times n)\n\n- Space complexity:\nO(1)\n\n# Code\n\nimpl Solution {\n    pub fn number_of_beams(bank: Vec<String>) -> 
![Screenshot 2024-01-03 at 12.00.06\u202FAM.png](https://assets.leetcode.com/users/images/9bcfdffc-61b3-4004-a93b-8b3cf151546a_1704268932.3736737.png)\n\n# Complexity\n- Time complexity:\n$$O(m \\times n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```\nimpl Solution {\n    pub fn number_of_beams(bank: Vec<String>) -> i32 {\n        bank.into_iter()\n            .filter_map(|line| {\n                NonZeroI32::new(line.bytes().filter(|&byte| byte == b\'1\').count() as i32)\n            })\n            .fold((0, 0), |(res, prev), line| {\n                (res + prev * line.get(), line.get())\n            })\n            .0\n    }\n}\n\nuse std::num::NonZeroI32;\n```
['Iterator', 'Rust']