Skip to content

Commit

Permalink
change type in new code
Browse files Browse the repository at this point in the history
  • Loading branch information
Liber Wang committed Jul 12, 2022
1 parent b54d59a commit f637c7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/executor/paginator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ where
None => return Ok(0),
};
let num_items = match builder {
DbBackend::Postgres => result.try_get::<i64>("", "num_items")? as usize,
_ => result.try_get::<i32>("", "num_items")? as usize,
DbBackend::Postgres => result.try_get::<i64>("", "num_items")? as u64,
_ => result.try_get::<i32>("", "num_items")? as u64,
};
Ok(num_items as u64)
Ok(num_items)
}

/// Get the total number of pages
Expand All @@ -105,8 +105,8 @@ where
}

/// Compute the number of pages for the current page
fn compute_pages_number(&self, num_items: usize) -> usize {
(num_items / self.page_size) + (num_items % self.page_size > 0) as usize
fn compute_pages_number(&self, num_items: u64) -> u64 {
(num_items / self.page_size) + (num_items % self.page_size > 0) as u64
}

/// Increment the page counter
Expand Down

0 comments on commit f637c7e

Please sign in to comment.