Bump rust edition & reformat

This commit is contained in:
Andras Schmelczer 2025-01-07 22:25:59 +00:00
parent 13d5b35d1a
commit f4a87d073a
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
15 changed files with 44 additions and 45 deletions

View file

@ -1,4 +1,4 @@
use rand::{distributions::Alphanumeric, thread_rng, Rng as _};
use rand::{Rng as _, distributions::Alphanumeric, thread_rng};
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, Clone)]

View file

@ -6,7 +6,7 @@ use models::{
};
use sqlx::{sqlite::SqliteConnectOptions, types::chrono::Utc};
pub mod models;
use sqlx::{sqlite::SqlitePoolOptions, Pool, Sqlite};
use sqlx::{Pool, Sqlite, sqlite::SqlitePoolOptions};
use crate::config::database_config::DatabaseConfig;

View file

@ -1,8 +1,8 @@
use aide::OperationOutput;
use axum::{
Json,
http::StatusCode,
response::{IntoResponse, Response},
Json,
};
use log::{error, info};
use schemars::JsonSchema;

View file

@ -6,7 +6,7 @@ mod server;
mod utils;
use anyhow::{Context as _, Result};
use errors::{init_error, SyncServerError};
use errors::{SyncServerError, init_error};
use log::info;
use server::create_server;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

View file

@ -1,7 +1,7 @@
use super::app_state::AppState;
use crate::{
config::user_config::User,
errors::{unauthorized_error, SyncServerError},
errors::{SyncServerError, unauthorized_error},
};
pub fn auth(app_state: &AppState, token: &str) -> Result<User, SyncServerError> {

View file

@ -1,19 +1,17 @@
use anyhow::Context as _;
use axum::{
extract::{Path, State},
Json,
};
use axum::extract::{Path, State};
use axum_extra::{
headers::{authorization::Bearer, Authorization},
TypedHeader,
headers::{Authorization, authorization::Bearer},
};
use axum_jsonschema::Json;
use schemars::JsonSchema;
use serde::Deserialize;
use super::{app_state::AppState, auth::auth, requests::DeleteDocumentVersion};
use crate::{
database::models::{DocumentId, StoredDocumentVersion, VaultId},
errors::{server_error, SyncServerError},
errors::{SyncServerError, server_error},
utils::sanitize_path,
};

View file

@ -1,19 +1,17 @@
use anyhow::anyhow;
use axum::{
extract::{Path, State},
Json,
};
use axum::extract::{Path, State};
use axum_extra::{
headers::{authorization::Bearer, Authorization},
TypedHeader,
headers::{Authorization, authorization::Bearer},
};
use axum_jsonschema::Json;
use schemars::JsonSchema;
use serde::Deserialize;
use super::{app_state::AppState, auth::auth};
use crate::{
database::models::{DocumentId, DocumentVersion, VaultId},
errors::{not_found_error, server_error, SyncServerError},
errors::{SyncServerError, not_found_error, server_error},
};
// This is required for aide to infer the path parameter types and names

View file

@ -1,18 +1,16 @@
use axum::{
extract::{Path, Query, State},
Json,
};
use axum::extract::{Path, Query, State};
use axum_extra::{
headers::{authorization::Bearer, Authorization},
TypedHeader,
headers::{Authorization, authorization::Bearer},
};
use axum_jsonschema::Json;
use schemars::JsonSchema;
use serde::Deserialize;
use super::{app_state::AppState, auth::auth, responses::FetchLatestDocumentsResponse};
use crate::{
database::models::{VaultId, VaultUpdateId},
errors::{server_error, SyncServerError},
errors::{SyncServerError, server_error},
};
// This is required for aide to infer the path parameter types and names

View file

@ -1,7 +1,7 @@
use axum::{extract::State, Json};
use axum::{Json, extract::State};
use axum_extra::{
headers::{authorization::Bearer, Authorization},
TypedHeader,
headers::{Authorization, authorization::Bearer},
};
use super::{app_state::AppState, auth::auth, responses::PingResponse};