MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / recursive_func

Function recursive_func

Source Code/11-04.rs:14–18  ·  view source on GitHub ↗
(n: usize)

Source from the content-addressed store, hash-verified

12 const N_ARRAY: usize = 1_000_000;
13 fn create_array() -> [u8; SIZE] { [0u8; SIZE] }
14 fn recursive_func(n: usize) {
15 let a = create_array();
16 println!("{} {}", N_ARRAY - n + 1, a[0]);
17 if n > 1 { recursive_func(n - 1) }
18 }
19 recursive_func(N_ARRAY);
20}

Callers 1

mainFunction · 0.70

Calls 1

create_arrayFunction · 0.70

Tested by

no test coverage detected