MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / main

Function main

code/chapter05/binary_search.rs:41–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41fn main() {
42 let nums = [1,3,8,10,15,32,44,48,50,55,60,62,64];
43
44 let mut num = 3;
45 let found = binary_search1(&nums, num);
46 println!("{num} is in nums: {found}");
47
48 num = 63;
49 let found = binary_search1(&nums, num);
50 println!("{num} is in nums: {found}");
51
52 num = 3;
53 let found = binary_search2(&nums, num);
54 println!("{num} is in nums: {found}");
55
56 num = 63;
57 let found = binary_search2(&nums, num);
58 println!("{num} is in nums: {found}");
59}

Callers

nothing calls this directly

Calls 2

binary_search1Function · 0.70
binary_search2Function · 0.70

Tested by

no test coverage detected