Skip to content

Commit

Permalink
Another clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Mar 15, 2024
1 parent c4ae62a commit 67cac15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/postgres/advanced-blog-cli/src/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<T> Paginated<T> {
{
let per_page = self.per_page;
let results = self.load::<(U, i64)>(conn)?;
let total = results.get(0).map(|x| x.1).unwrap_or(0);
let total = results.first().map(|x| x.1).unwrap_or(0);
let records = results.into_iter().map(|x| x.0).collect();
let total_pages = (total as f64 / per_page as f64).ceil() as i64;
Ok((records, total_pages))
Expand Down

0 comments on commit 67cac15

Please sign in to comment.