fmt: cleanup & cargo fmt
This commit is contained in:
parent
b8e1235396
commit
2c91e99a4d
@ -67,14 +67,14 @@ impl IntoResponse for ApiError {
|
|||||||
StatusCode::UNAUTHORIZED,
|
StatusCode::UNAUTHORIZED,
|
||||||
Json(RegistrationResponse::user_interactive_authorization_info()),
|
Json(RegistrationResponse::user_interactive_authorization_info()),
|
||||||
).into_response(),
|
).into_response(),
|
||||||
RegistrationError::InvalidUserId => (StatusCode::OK, Json(
|
RegistrationError::InvalidUserId | RegistrationError::MissingUserId => (
|
||||||
ErrorResponse::new(
|
StatusCode::BAD_REQUEST,
|
||||||
|
Json(ErrorResponse::new(
|
||||||
ErrorCode::InvalidUsername,
|
ErrorCode::InvalidUsername,
|
||||||
®istration_error.to_string(),
|
®istration_error.to_string(),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
)).into_response(),
|
)).into_response(),
|
||||||
RegistrationError::MissingUserId => (StatusCode::OK, String::new()).into_response(),
|
|
||||||
RegistrationError::UserIdTaken => (
|
RegistrationError::UserIdTaken => (
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
Json(ErrorResponse::new(
|
Json(ErrorResponse::new(
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
pub mod auth;
|
pub mod auth;
|
||||||
pub mod versions;
|
|
||||||
pub mod errors;
|
pub mod errors;
|
||||||
|
pub mod versions;
|
||||||
|
10
src/main.rs
10
src/main.rs
@ -35,7 +35,7 @@ impl Default for Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() -> anyhow::Result<()> {
|
||||||
if std::env::var("RUST_LOG").is_err() {
|
if std::env::var("RUST_LOG").is_err() {
|
||||||
std::env::set_var("RUST_LOG", "debug");
|
std::env::set_var("RUST_LOG", "debug");
|
||||||
}
|
}
|
||||||
@ -44,9 +44,7 @@ async fn main() {
|
|||||||
|
|
||||||
let config = Arc::new(Config::default());
|
let config = Arc::new(Config::default());
|
||||||
|
|
||||||
let pool = sqlx::SqlitePool::connect(&config.db_path)
|
let pool = sqlx::SqlitePool::connect(&config.db_path).await?;
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let cors = CorsLayer::new()
|
let cors = CorsLayer::new()
|
||||||
.allow_origin(tower_http::cors::Any)
|
.allow_origin(tower_http::cors::Any)
|
||||||
@ -69,7 +67,9 @@ async fn main() {
|
|||||||
|
|
||||||
let _ = axum::Server::bind(&"127.0.0.1:3000".parse().unwrap())
|
let _ = axum::Server::bind(&"127.0.0.1:3000".parse().unwrap())
|
||||||
.serve(router.into_make_service())
|
.serve(router.into_make_service())
|
||||||
.await;
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn fallback(request: Request<Body>) -> StatusCode {
|
async fn fallback(request: Request<Body>) -> StatusCode {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
pub mod authentication_data;
|
pub mod authentication_data;
|
||||||
|
pub mod error_code;
|
||||||
pub mod flow;
|
pub mod flow;
|
||||||
pub mod identifier;
|
pub mod identifier;
|
||||||
pub mod identifier_type;
|
pub mod identifier_type;
|
||||||
pub mod matrix_user_id;
|
pub mod matrix_user_id;
|
||||||
pub mod user_interactive_authorization;
|
pub mod user_interactive_authorization;
|
||||||
pub mod error_code;
|
|
Loading…
x
Reference in New Issue
Block a user