Skip to content

Commit 84f1867

Browse files
committed
chore: upgrade axum 0.7 to 0.8 to deduplicate with tonic's axum
atuin-server used axum 0.7 while tonic already pulled in axum 0.8, resulting in both versions compiled into the binary. Migrates to axum 0.8: path params use {param} syntax, FromRequestParts uses native async traits (dropping async-trait dep from atuin-server).
1 parent c2fa604 commit 84f1867

File tree

3 files changed

+12
-68
lines changed

3 files changed

+12
-68
lines changed

Cargo.lock

Lines changed: 9 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/atuin-server/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ serde = { workspace = true }
3232
serde_json = { workspace = true }
3333
rand = { workspace = true }
3434
tokio = { workspace = true }
35-
async-trait = { workspace = true }
36-
axum = "0.7"
35+
axum = "0.8"
3736
fs-err = { workspace = true }
3837
tower = { workspace = true }
3938
tower-http = { version = "0.6", features = ["trace"] }

crates/atuin-server/src/router.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use async_trait::async_trait;
21
use atuin_common::api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ErrorResponse};
32
use axum::{
43
Router,
@@ -22,7 +21,6 @@ use atuin_server_database::{Database, DbError, models::User};
2221

2322
pub struct UserAuth(pub User);
2423

25-
#[async_trait]
2624
impl<DB: Send + Sync> FromRequestParts<AppState<DB>> for UserAuth
2725
where
2826
DB: Database,
@@ -118,14 +116,14 @@ pub fn router<DB: Database>(database: DB, settings: Settings) -> Router {
118116
routes = routes
119117
.route("/sync/count", get(handlers::history::count))
120118
.route("/sync/history", get(handlers::history::list))
121-
.route("/sync/calendar/:focus", get(handlers::history::calendar))
119+
.route("/sync/calendar/{focus}", get(handlers::history::calendar))
122120
.route("/sync/status", get(handlers::status::status))
123121
.route("/history", post(handlers::history::add))
124122
.route("/history", delete(handlers::history::delete));
125123
}
126124

127125
let routes = routes
128-
.route("/user/:username", get(handlers::user::get))
126+
.route("/user/{username}", get(handlers::user::get))
129127
.route("/account", delete(handlers::user::delete))
130128
.route("/account/password", patch(handlers::user::change_password))
131129
.route("/register", post(handlers::user::register))

0 commit comments

Comments
 (0)