mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-11-30 23:41:22 -06:00
4 lines
83 B
Rust
4 lines
83 B
Rust
pub fn sum_array(x: &[i32]) -> i32 {
|
|
x.iter().fold(0, |sum, next| sum + *next)
|
|
}
|