Mercurial > public > mercurial-scm > hg
diff rust/hg-core/examples/nodemap/main.rs @ 46432:18a261b11b20
rust: Remove hex parsing from the nodemap
Separating concerns simplifies error types.
Differential Revision: https://phab.mercurial-scm.org/D9864
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 25 Jan 2021 18:25:26 +0100 |
parents | 6380efb82191 |
children | e834b79def74 |
line wrap: on
line diff
--- a/rust/hg-core/examples/nodemap/main.rs Mon Jan 25 11:48:47 2021 +0100 +++ b/rust/hg-core/examples/nodemap/main.rs Mon Jan 25 18:25:26 2021 +0100 @@ -49,7 +49,7 @@ fn query(index: &Index, nm: &NodeTree, prefix: &str) { let start = Instant::now(); - let res = nm.find_hex(index, prefix); + let res = NodePrefix::from_hex(prefix).map(|p| nm.find_bin(index, p)); println!("Result found in {:?}: {:?}", start.elapsed(), res); }