Skip to content

Commit

Permalink
fix(code): remove unused import in "paginate" function
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Aug 21, 2024
1 parent 4649554 commit fe96128
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ fn build_table_fns(
buffer.push_str(&format!(r##"
/// Paginates through the table where page is a 0-based index (i.e. page 0 is the first page)
pub{async_keyword} fn paginate(db: &mut ConnectionType, page: i64, page_size: i64, filter: {struct_name}Filter) -> diesel::QueryResult<PaginationResult<Self>> {{
use {schema_path}{table_name}::dsl::*;
let page = page.max(0);
let page_size = page_size.max(1);
let total_items = Self::filter(filter.clone()).count().get_result(db){await_keyword}?;
Expand Down
2 changes: 0 additions & 2 deletions test/advanced_queries/models/todos/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ impl Todos {

/// Paginates through the table where page is a 0-based index (i.e. page 0 is the first page)
pub fn paginate(db: &mut ConnectionType, page: i64, page_size: i64, filter: TodosFilter) -> diesel::QueryResult<PaginationResult<Self>> {
use crate::schema::todos::dsl::*;

let page = page.max(0);
let page_size = page_size.max(1);
let total_items = Self::filter(filter.clone()).count().get_result(db)?;
Expand Down

0 comments on commit fe96128

Please sign in to comment.