Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
72bdb086ded3535f0c5cd0fecd53f61f6ecf5e75
/
.
/
examples
/
rust
/
sum_over_array.rs
blob: 6af470e2dbf3008d2c1f4538bc329df9dd9f9d0b [
file
] [
log
] [
blame
] [
raw
]
pub
fn
sum_array
(
x
:
&[
i32
])
->
i32
{
x
.
iter
().
fold
(
0
,
|
sum
,
next
|
sum
+
*
next
)
}