From ef2074f65bc9d8ae23c6932baeb2b857d49c6c15 Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Tue, 6 Oct 2026 18:15:45 +0300 Subject: [PATCH] Move files around --- src/api/syncs.rs | 2 +- src/app.rs | 2 +- src/app_error.rs | 3 ++- src/auth_user.rs | 2 +- src/lib.rs | 3 +-- src/repository/mod.rs | 2 ++ src/{sync.rs => repository/progress_sync.rs} | 3 ++- src/{ => repository}/users.rs | 0 8 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 src/repository/mod.rs rename src/{sync.rs => repository/progress_sync.rs} (99%) rename src/{ => repository}/users.rs (100%) diff --git a/src/api/syncs.rs b/src/api/syncs.rs index 45ae073..91d505f 100644 --- a/src/api/syncs.rs +++ b/src/api/syncs.rs @@ -5,7 +5,7 @@ use axum::{Json, Router, extract::{Path, State}, response::{IntoResponse, Respon use serde::{Deserialize, Serialize}; use tracing::instrument; -use crate::{app::AppState, app_error::AppError, auth_user::AuthUser, sync::Document}; +use crate::{app::AppState, app_error::AppError, auth_user::AuthUser, repository::progress_sync::Document}; pub fn syncs_routes() -> Router { diff --git a/src/app.rs b/src/app.rs index 573f965..c209c70 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2,7 +2,7 @@ use std::{path::Path, sync::Arc}; use axum::extract::FromRef; -use crate::{config::Config, reader::Reader, sync::ProgressSync, users::Users, writer::Writer}; +use crate::{config::Config, reader::Reader, repository::{progress_sync::ProgressSync, users::Users}, writer::Writer}; #[derive(Clone, FromRef)] pub struct AppState { diff --git a/src/app_error.rs b/src/app_error.rs index 761fa82..9397c80 100644 --- a/src/app_error.rs +++ b/src/app_error.rs @@ -1,7 +1,8 @@ use axum::{Json, http::StatusCode, response::IntoResponse}; use thiserror::Error; -use crate::{sync::SyncError, users::UserError}; +use crate::repository::{progress_sync::SyncError, users::UserError}; + // The AppError represents the different error types from upstream kosync server diff --git a/src/auth_user.rs b/src/auth_user.rs index 361223b..8268722 100644 --- a/src/auth_user.rs +++ b/src/auth_user.rs @@ -1,7 +1,7 @@ use axum::extract::{FromRef as _, FromRequestParts}; use secrecy::SecretString; -use crate::{app::AppState, app_error::AppError, users}; +use crate::{app::AppState, app_error::AppError, repository::users}; pub struct AuthUser { pub username: String } diff --git a/src/lib.rs b/src/lib.rs index 10ada9a..77b2806 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ pub mod config; pub mod writer; -pub mod users; -pub mod sync; +pub mod repository; pub mod reader; pub mod api; pub mod app; diff --git a/src/repository/mod.rs b/src/repository/mod.rs new file mode 100644 index 0000000..069772c --- /dev/null +++ b/src/repository/mod.rs @@ -0,0 +1,2 @@ +pub mod progress_sync; +pub mod users; diff --git a/src/sync.rs b/src/repository/progress_sync.rs similarity index 99% rename from src/sync.rs rename to src/repository/progress_sync.rs index a89df4f..46d75c7 100644 --- a/src/sync.rs +++ b/src/repository/progress_sync.rs @@ -157,7 +157,8 @@ mod tests { use secrecy::SecretString; use tempfile::{TempDir, tempdir}; - use crate::users::Users; + + use crate::repository::users::Users; use super::*; diff --git a/src/users.rs b/src/repository/users.rs similarity index 100% rename from src/users.rs rename to src/repository/users.rs