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