Skip to content

Commit 333554d

Browse files
committed
A few more fixups
1 parent 7cd2a57 commit 333554d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/controllers/crate_owner_invitation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn prepare_list(
125125
crate_owner_invitations::invited_user_id,
126126
))
127127
// We fetch one element over the page limit to then detect whether there is a next page.
128-
.limit(pagination.per_page as i64 + 1);
128+
.limit(pagination.per_page + 1);
129129

130130
// Load and paginate the results.
131131
let mut raw_invitations: Vec<CrateOwnerInvitation> = match pagination.page {

src/controllers/helpers/pagination.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ where
236236
out.push_sql(") t LIMIT ");
237237
out.push_bind_param::<BigInt, _>(&self.options.per_page)?;
238238
if let Some(offset) = self.options.offset() {
239-
out.push_sql(format!(" OFFSET {}", offset).as_str());
239+
out.push_sql(format!(" OFFSET {offset}").as_str());
240240
}
241241
Ok(())
242242
}

src/controllers/krate/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pub fn search(req: &mut dyn RequestExt) -> EndpointResult {
263263
let (total, next_page, prev_page, data, conn) = if supports_seek && !explicit_page {
264264
// Equivalent of:
265265
// `WHERE name > (SELECT name FROM crates WHERE id = $1) LIMIT $2`
266-
query = query.limit(pagination.per_page as i64);
266+
query = query.limit(pagination.per_page);
267267
if let Some(seek) = seek {
268268
let crate_name: String = crates::table
269269
.find(seek)

src/models/token/scopes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use diesel::sql_types::Text;
66
use std::io::Write;
77

88
#[derive(Clone, Copy, Debug, PartialEq, Eq, AsExpression)]
9-
#[sql_type = "Text"]
9+
#[diesel(sql_type = Text)]
1010
pub enum EndpointScope {
1111
PublishNew,
1212
PublishUpdate,

0 commit comments

Comments
 (0)