Skip to content

Commit 34790f3

Browse files
authored
Merge pull request #65 from himkt/docs-search
refactor(search): add doc comments
2 parents b7091bd + 68479ac commit 34790f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/search.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// Returns the smallest index on [l, r) satisfying the condition.
12
pub fn lower_bound(range: std::ops::Range<usize>, prop: &dyn Fn(usize) -> bool) -> Option<usize> {
23
if prop(range.start) {
34
return Some(range.start);
@@ -36,6 +37,7 @@ mod test_lower_bound {
3637
}
3738
}
3839

40+
/// Returns the largest index on [l, r) satisfying the condition.
3941
pub fn upper_bound(range: std::ops::Range<usize>, prop: &dyn Fn(usize) -> bool) -> Option<usize> {
4042
if !prop(range.start) {
4143
return None;

0 commit comments

Comments
 (0)