correct arithmetic adjustments

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-05 20:40:58 -04:00 committed by June
parent 16a98b0683
commit 321e197d8c
12 changed files with 24 additions and 53 deletions

View file

@ -39,7 +39,7 @@ pub(crate) async fn process(command: RoomDirectoryCommand, _body: Vec<&str>) ->
let rooms = rooms
.into_iter()
.skip(page.checked_sub(1).unwrap().checked_mul(PAGE_SIZE).unwrap())
.skip(page.saturating_sub(1).saturating_mul(PAGE_SIZE))
.take(PAGE_SIZE)
.collect::<Vec<_>>();