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

Function main

publication/code/chapter06/binary_search.rs:42–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

binary_search1Function · 0.70
binary_search2Function · 0.70

Tested by

no test coverage detected