Skip to content

Commit 2394913

Browse files
haasonsaasclaude
andcommitted
Fix clippy warnings: use clamp() for pagination bounds
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eab6fc3 commit 2394913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ pub async fn list_reviews(
306306
.collect();
307307
list.sort_by(|a, b| b.started_at.cmp(&a.started_at));
308308

309-
let page = params.page.unwrap_or(1).max(1).min(10_000);
310-
let per_page = params.per_page.unwrap_or(20).max(1).min(100);
309+
let page = params.page.unwrap_or(1).clamp(1, 10_000);
310+
let per_page = params.per_page.unwrap_or(20).clamp(1, 100);
311311
let start = (page - 1).saturating_mul(per_page);
312312
let list = if start < list.len() {
313313
let end = list.len().min(start.saturating_add(per_page));

0 commit comments

Comments
 (0)