chore: update Rust to 2024 edition (#2066)

This commit is contained in:
Luna Yao
2026-04-09 18:22:12 +02:00
committed by GitHub
parent a8feb9ac2b
commit a879dd1b14
158 changed files with 1327 additions and 1231 deletions
+12 -11
View File
@@ -1,7 +1,7 @@
use axum::{
Router,
http::StatusCode,
routing::{get, post, put},
Router,
};
use axum_login::login_required;
use axum_messages::Message;
@@ -14,8 +14,8 @@ use std::sync::Arc;
use crate::FeatureFlags;
use super::{
users::{AuthSession, Credentials},
AppStateInner,
users::{AuthSession, Credentials},
};
#[derive(Debug, Deserialize, Serialize)]
@@ -44,7 +44,7 @@ mod put {
use axum_login::AuthUser;
use easytier::proto::common::Void;
use crate::restful::{other_error, users::ChangePassword, HttpHandleError};
use crate::restful::{HttpHandleError, other_error, users::ChangePassword};
use super::*;
@@ -71,14 +71,14 @@ mod put {
}
mod post {
use axum::{extract::Extension, Json};
use axum::{Json, extract::Extension};
use easytier::proto::common::Void;
use crate::restful::{
captcha::extension::{axum_tower_sessions::CaptchaAxumTowerSessionStaticExt, CaptchaUtil},
HttpHandleError,
captcha::extension::{CaptchaUtil, axum_tower_sessions::CaptchaAxumTowerSessionStaticExt},
other_error,
users::RegisterNewUser,
HttpHandleError,
};
use super::*;
@@ -99,7 +99,7 @@ mod post {
return Err((
StatusCode::INTERNAL_SERVER_ERROR,
Json::from(other_error(format!("{:?}", e))),
))
));
}
};
@@ -150,14 +150,15 @@ mod post {
mod get {
use crate::restful::{
HttpHandleError,
captcha::{
builder::spec::SpecCaptcha,
extension::{axum_tower_sessions::CaptchaAxumTowerSessionExt as _, CaptchaUtil},
NewCaptcha as _,
builder::spec::SpecCaptcha,
extension::{CaptchaUtil, axum_tower_sessions::CaptchaAxumTowerSessionExt as _},
},
other_error, HttpHandleError,
other_error,
};
use axum::{response::Response, Json};
use axum::{Json, response::Response};
use easytier::proto::common::Void;
use tower_sessions::Session;