completed till 11
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
// TODO: Define a function named `sum` that takes a reference to a slice of `u32` and returns the sum of all
|
||||
// elements in the slice.
|
||||
|
||||
fn sum(v: &[u32]) -> u32 {
|
||||
v.iter().sum()
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user