Skip to content

Commit

Permalink
test: fix compilation for fmindex benchmark. (#466)
Browse files Browse the repository at this point in the history
This was broken by eb9d378.

Having compilation broken is an annoyence when one attempts to run
`cargo check --all-targets`.
  • Loading branch information
adam-azarchs committed Nov 17, 2021
1 parent a4843ad commit 9e8a7ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions benches/fmindex.rs
Expand Up @@ -4,7 +4,7 @@ extern crate test;

use bio::alphabets;
use bio::data_structures::bwt::{bwt, less, Occ};
use bio::data_structures::fmindex::{FMIndex, FMIndexable};
use bio::data_structures::fmindex::{BackwardSearchResult, FMIndex, FMIndexable};
use bio::data_structures::suffix_array::suffix_array;
use test::Bencher;

Expand All @@ -26,9 +26,13 @@ fn search_index_seeds(b: &mut Bencher) {

let mut loc_temp = Vec::new();
for (offset, seed) in seeds {
let interval = fmindex.backward_search(seed.iter());

loc_temp.extend((interval.lower..interval.upper).map(|i| (sa[i], offset)));
let interval = match fmindex.backward_search(seed.iter()) {
BackwardSearchResult::Complete(interval)
| BackwardSearchResult::Partial(interval, _) => {
loc_temp.extend((interval.lower..interval.upper).map(|i| (sa[i], offset)))
}
_ => panic!("no search result"),
};
}
});
}
Expand Down

0 comments on commit 9e8a7ca

Please sign in to comment.