make pdu batch tokens zeroith-indexed

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-06 22:21:51 +00:00
parent f36757027e
commit e507c31306
9 changed files with 67 additions and 52 deletions

View file

@ -150,10 +150,7 @@ async fn paginate_relations_with_filter(
Direction::Backward => events.first(),
}
.map(at!(0))
.map(|count| match dir {
Direction::Forward => count.saturating_add(1),
Direction::Backward => count.saturating_sub(1),
})
.map(|count| count.saturating_inc(dir))
.as_ref()
.map(ToString::to_string);