From 68479ace4a537f323680ba104a1aefdc1aabeb53 Mon Sep 17 00:00:00 2001 From: himkt Date: Sun, 14 Dec 2025 22:24:04 +0900 Subject: [PATCH] refactor(search): add doc comments --- src/search.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/search.rs b/src/search.rs index 35c5a7d..b5be5c4 100644 --- a/src/search.rs +++ b/src/search.rs @@ -1,3 +1,4 @@ +/// Returns the smallest index on [l, r) satisfying the condition. pub fn lower_bound(range: std::ops::Range, prop: &dyn Fn(usize) -> bool) -> Option { if prop(range.start) { return Some(range.start); @@ -36,6 +37,7 @@ mod test_lower_bound { } } +/// Returns the largest index on [l, r) satisfying the condition. pub fn upper_bound(range: std::ops::Range, prop: &dyn Fn(usize) -> bool) -> Option { if !prop(range.start) { return None;