Skip to content

Commit 2a1048f

Browse files
committed
update to the new edtion 2024
1 parent 93dbcd7 commit 2a1048f

30 files changed

Lines changed: 55 additions & 57 deletions

File tree

Cargo.toml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rustfulapi"
33
authors = ["Mahdi Robatipoor<mahdi.robatipoor@gmail.com>"]
44
description = "RESTful API template built with Rust language"
5-
edition = "2021"
5+
edition = "2024"
66
homepage = "https://github.com/robatipoor/rustfulapi"
77
keywords = ["web", "api", "rest","orm"]
88
license = "MIT"
@@ -18,8 +18,8 @@ name = "migration"
1818
path = "./src/bin/migration.rs"
1919

2020
[dependencies]
21-
axum = { version = "0.7.9", features = ["ws"] }
22-
axum-extra = { version = "0.9.6", features = ["typed-header"] }
21+
axum = { version = "0.8.1", features = ["ws"] }
22+
axum-extra = { version = "0.10.0", features = ["typed-header"] }
2323
sea-orm = { version = "1.1.2", features = [
2424
"sqlx-postgres",
2525
"runtime-tokio-rustls",
@@ -31,34 +31,33 @@ sea-orm-migration = { version = "1.1.2", features = [
3131
] }
3232
anyhow = "1.0.94"
3333
argon2 = "0.5.3"
34-
async-trait = "0.1.83"
3534
base64 = "0.22.1"
3635
chrono = { version = "0.4.39", default-features = false, features = [
3736
"clock",
3837
"serde",
3938
] }
40-
config = "0.14.1"
41-
fake = { version = "3.0.1", features = ["derive", "uuid", "chrono"] }
39+
config = "0.15.8"
40+
fake = { version = "4.0.0", features = ["derive", "uuid", "chrono"] }
4241
futures = "0.3.31"
43-
itertools = "0.13.0"
42+
itertools = "0.14.0"
4443
jsonwebtoken = "9.3.0"
4544
lettre = { version = "0.11.11", features = ["tokio1-native-tls", "builder"] }
4645
log = "0.4.22"
4746
log-derive = "0.4.1"
4847
openssl = "0.10.68"
49-
rand = "0.8.5"
50-
rand_core = { version = "0.6.4", features = ["std"] }
51-
redis = { version = "0.27.6", features = ["tokio-comp"] }
48+
rand = "0.9.0"
49+
rand_core = { version = "0.9.2", features = ["std"] }
50+
redis = { version = "0.29.0", features = ["tokio-comp"] }
5251
reqwest = { version = "0.12.9", features = ["json", "multipart", "stream"] }
53-
scraper = "0.22.0"
54-
sentry = "0.35.0"
52+
scraper = "0.23.1"
53+
sentry = "0.36.0"
5554
serde = { version = "1.0.215", features = ["derive"] }
5655
serde_json = "1.0.133"
5756
sha2 = "0.10.8"
58-
strum = { version = "0.26.3", features = ["derive"] }
57+
strum = { version = "0.27.1", features = ["derive"] }
5958
tera = "1.20.0"
60-
test-context = "0.3.0"
61-
thiserror = "2.0.6"
59+
test-context = "0.4.1"
60+
thiserror = "2.0.11"
6261
tokio = { version = "1.42.0", features = ["full"] }
6362
tracing = { version = "0.1.41", features = ["attributes"] }
6463
tracing-appender = "0.2.3"
@@ -70,10 +69,10 @@ tracing-subscriber = { version = "0.3.19", features = [
7069
] }
7170
url = "2.5.2"
7271
utoipa = { version = "5.2.0", features = ["axum_extras", "uuid", "chrono"] }
73-
utoipa-swagger-ui = { version = "8.0.3", features = ["axum"] }
74-
utoipa-axum = "0.1.2"
72+
utoipa-swagger-ui = { version = "9.0.0", features = ["axum"] }
73+
utoipa-axum = "0.2.0"
7574
uuid = { version = "1.11.0", features = ["v4", "serde"] }
76-
tokio-tungstenite = "0.24.0"
77-
garde = { version = "0.20.0", features = ["full"] }
75+
tokio-tungstenite = "0.26.2"
76+
garde = { version = "0.22.0", features = ["full"] }
7877
regex = "1.11.1"
7978
wiremock = "0.6.2"

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# rustfmt configurations from master branch, check rustfmt version
22
# (cargo fmt --version).
33
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md
4-
edition = "2021"
4+
edition = "2024"
55
tab_spaces = 2
66
reorder_imports = true

scripts/init_mockserver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if [[ -n $RUNNING_CONTAINER ]]; then
3232
else
3333
echo >&2 "update exceptions"
3434
curl -X PUT -H "Content-Type: application/json" \
35-
-d @"${SCRIPT_PATH}"/mockserver-expections/init.json \
35+
-d @"${SCRIPT_PATH}"/mockserver-expectations/init.json \
3636
localhost:"${PORT}"/mockserver/expectation
3737
echo >&2 "you can kill container with command :"
3838
echo >&2 "docker kill ${RUNNING_CONTAINER}"

src/bin/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use futures::FutureExt;
22
use rustfulapi::constant::CONFIG;
33
use rustfulapi::error::AppResult;
4-
use rustfulapi::server::worker::MessengerTask;
54
use rustfulapi::server::AppServer;
5+
use rustfulapi::server::worker::MessengerTask;
66
use rustfulapi::{configure, util};
77
use tracing::info;
88

src/client/redis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{
2-
configure::{redis::RedisConfig, AppConfig},
2+
configure::{AppConfig, redis::RedisConfig},
33
constant::CONFIG,
44
error::AppResult,
55
};
@@ -22,7 +22,7 @@ pub trait RedisClientExt: ClientBuilder {
2222
) -> impl std::future::Future<Output = Result<(), RedisError>>;
2323
fn exist(&self, key: &str) -> impl std::future::Future<Output = Result<bool, RedisError>>;
2424
fn get(&self, key: &str)
25-
-> impl std::future::Future<Output = Result<Option<String>, RedisError>>;
25+
-> impl std::future::Future<Output = Result<Option<String>, RedisError>>;
2626
fn del(&self, key: &str) -> impl std::future::Future<Output = Result<bool, RedisError>>;
2727
fn ttl(&self, key: &str) -> impl std::future::Future<Output = Result<i64, RedisError>>;
2828
}

src/configure/tracing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use tracing::{subscriber, Subscriber};
1+
use tracing::{Subscriber, subscriber};
22
use tracing_appender::{
33
non_blocking::WorkerGuard,
44
rolling::{RollingFileAppender, Rotation},
55
};
66
use tracing_bunyan_formatter::{BunyanFormattingLayer, JsonStorageLayer};
77
use tracing_log::LogTracer;
8-
use tracing_subscriber::{fmt::MakeWriter, layer::SubscriberExt, EnvFilter, Registry};
8+
use tracing_subscriber::{EnvFilter, Registry, fmt::MakeWriter, layer::SubscriberExt};
99

1010
use crate::error::AppResult;
1111

src/constant/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{path::PathBuf, sync::LazyLock, time::Duration};
33
use utoipa::OpenApi;
44

55
use crate::{
6-
client::{email::EmailClient, http::HttpClient, redis::RedisClient, ClientBuilder},
6+
client::{ClientBuilder, email::EmailClient, http::HttpClient, redis::RedisClient},
77
configure::{env::get_profile, get_static_dir, template::TemplateEngine},
88
handler::openapi::ApiDoc,
99
};

src/dto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use fake::Dummy;
12
use fake::faker::internet::en::SafeEmail;
23
use fake::faker::lorem::en::{Paragraph, Sentence};
3-
use fake::Dummy;
44
use garde::Validate;
55
use lettre::Message;
66
pub use request::*;

src/dto/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fake::faker::internet::en::{Password, SafeEmail, Username};
21
use fake::Dummy;
2+
use fake::faker::internet::en::{Password, SafeEmail, Username};
33
use garde::Validate;
44
use serde::{Deserialize, Serialize};
55
use strum::Display;

src/entity/user.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use chrono::{DateTime, Utc};
2-
use fake::faker::internet::en::{FreeEmail, Password, Username};
32
use fake::Dummy;
3+
use fake::faker::internet::en::{FreeEmail, Password, Username};
44
use sea_orm::entity::prelude::*;
55

66
use crate::error::ResourceType;
77

8-
use super::role::RoleUser;
98
use super::AppEntity;
9+
use super::role::RoleUser;
1010

1111
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Dummy, DeriveEntityModel)]
1212
#[sea_orm(table_name = "users")]

0 commit comments

Comments
 (0)