From 0fea81eb5e54e73766f74d0ceff69bbe2fdb221c Mon Sep 17 00:00:00 2001 From: Sanford Pun Date: Wed, 7 Sep 2022 23:09:56 +0100 Subject: [PATCH] Update usize used in paginate to u64 (PR#789) --- examples/actix3_example/Cargo.toml | 24 ----------------------- examples/actix3_example/api/src/lib.rs | 6 +++--- examples/actix3_example/core/Cargo.toml | 2 +- examples/actix3_example/core/src/query.rs | 6 +++--- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/examples/actix3_example/Cargo.toml b/examples/actix3_example/Cargo.toml index de7a7335a..a449de4ca 100644 --- a/examples/actix3_example/Cargo.toml +++ b/examples/actix3_example/Cargo.toml @@ -10,27 +10,3 @@ members = [".", "api", "core", "entity", "migration"] [dependencies] actix3-example-api = { path = "api" } -actix-http = "2" -actix-web = "3" -actix-flash = "0.2" -actix-files = "0.5" -futures = { version = "^0.3" } -futures-util = { version = "^0.3" } -tera = "1.8.0" -dotenv = "0.15" -listenfd = "0.3.3" -serde = "1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } -entity = { path = "entity" } -migration = { path = "migration" } - -[dependencies.sea-orm] -path = "../../" # remove this line in your own project -version = "^0.10.0" # sea-orm version -features = [ - "debug-print", - "runtime-async-std-native-tls", - "sqlx-mysql", - # "sqlx-postgres", - # "sqlx-sqlite", -] diff --git a/examples/actix3_example/api/src/lib.rs b/examples/actix3_example/api/src/lib.rs index d5160f876..275e4a7cc 100644 --- a/examples/actix3_example/api/src/lib.rs +++ b/examples/actix3_example/api/src/lib.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; use std::env; use tera::Tera; -const DEFAULT_POSTS_PER_PAGE: usize = 5; +const DEFAULT_POSTS_PER_PAGE: u64 = 5; #[derive(Debug, Clone)] struct AppState { @@ -23,8 +23,8 @@ struct AppState { } #[derive(Debug, Deserialize)] pub struct Params { - page: Option, - posts_per_page: Option, + page: Option, + posts_per_page: Option, } #[derive(Deserialize, Serialize, Debug, Clone)] diff --git a/examples/actix3_example/core/Cargo.toml b/examples/actix3_example/core/Cargo.toml index 2c4c3f39b..c0548ff49 100644 --- a/examples/actix3_example/core/Cargo.toml +++ b/examples/actix3_example/core/Cargo.toml @@ -10,7 +10,7 @@ entity = { path = "../entity" } [dependencies.sea-orm] path = "../../../" # remove this line in your own project -version = "^0.9.0" # sea-orm version +version = "^0.10.0" # sea-orm version features = [ "debug-print", "runtime-async-std-native-tls", diff --git a/examples/actix3_example/core/src/query.rs b/examples/actix3_example/core/src/query.rs index f08e80c77..e8d2668f5 100644 --- a/examples/actix3_example/core/src/query.rs +++ b/examples/actix3_example/core/src/query.rs @@ -11,9 +11,9 @@ impl Query { /// If ok, returns (post models, num pages). pub async fn find_posts_in_page( db: &DbConn, - page: usize, - posts_per_page: usize, - ) -> Result<(Vec, usize), DbErr> { + page: u64, + posts_per_page: u64, + ) -> Result<(Vec, u64), DbErr> { // Setup paginator let paginator = Post::find() .order_by_asc(post::Column::Id)