Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Apress/beginning-rust-2e
/ double
Function
double
Source Code/09-29.rs:4–8 ·
view source on GitHub ↗
(a: &mut [i32; 10])
Source
from the content-addressed store, hash-verified
2
[10, -8, 18, 0, -14, -2, 6, 10, 6, 2]*/
3
fn main() {
4
fn double(a: &mut [i32; 10]) {
5
for n in 0..10 {
6
(*a)[n] *= 2;
7
}
8
}
9
let mut arr = [5, -4, 9, 0, -7, -1, 3, 5, 3, 1];
10
double(&mut arr);
11
print!(
"{:?}"
, arr);
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected