chore: nettoyage de code mort (users::username remplacé par profile, clé i18n title_timer inutilisée)Unverified
Claude-Session: https://claude.ai/code/session_01FPKHKGfqvnvXKY9tNhYmkh
bd5a162 parent: 85f0632 modified
src/db/users.rs +0 -8 | @@ -37,14 +37,6 @@ pub async fn update_password(pool: &PgPool, id: Uuid, password_hash: &str) -> sq | ||
| 37 | 37 | Ok(()) |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -pub async fn username(pool: &PgPool, id: Uuid) -> sqlx::Result<Option<String>> { | |
| 41 | - let row: Option<(String,)> = sqlx::query_as("SELECT username FROM users WHERE id = $1") | |
| 42 | - .bind(id) | |
| 43 | - .fetch_optional(pool) | |
| 44 | - .await?; | |
| 45 | - Ok(row.map(|(u,)| u)) | |
| 46 | -} | |
| 47 | - | |
| 48 | 40 | /// (username, code langue) — profil minimal chargé à chaque requête. |
| 49 | 41 | pub async fn profile(pool: &PgPool, id: Uuid) -> sqlx::Result<Option<(String, String)>> { |
| 50 | 42 | sqlx::query_as("SELECT username, lang FROM users WHERE id = $1") |
| @@ -37,14 +37,6 @@ pub async fn update_password(pool: &PgPool, id: Uuid, password_hash: &str) -> sq | |||
| 37 | Ok(()) | 37 | Ok(()) |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | -pub async fn username(pool: &PgPool, id: Uuid) -> sqlx::Result<Option<String>> { | ||
| 41 | - let row: Option<(String,)> = sqlx::query_as("SELECT username FROM users WHERE id = $1") | ||
| 42 | - .bind(id) | ||
| 43 | - .fetch_optional(pool) | ||
| 44 | - .await?; | ||
| 45 | - Ok(row.map(|(u,)| u)) | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | /// (username, code langue) — profil minimal chargé à chaque requête. | 40 | /// (username, code langue) — profil minimal chargé à chaque requête. |
| 49 | pub async fn profile(pool: &PgPool, id: Uuid) -> sqlx::Result<Option<(String, String)>> { | 41 | pub async fn profile(pool: &PgPool, id: Uuid) -> sqlx::Result<Option<(String, String)>> { |
| 50 | sqlx::query_as("SELECT username, lang FROM users WHERE id = $1") | 42 | sqlx::query_as("SELECT username, lang FROM users WHERE id = $1") |
modified
src/i18n.rs +0 -4 | @@ -109,7 +109,6 @@ pub struct Tr { | ||
| 109 | 109 | pub err_duration_min: &'static str, |
| 110 | 110 | pub err_cat_team: &'static str, |
| 111 | 111 | // ─── minuteur ─── |
| 112 | - pub title_timer: &'static str, | |
| 113 | 112 | pub chrono_kicker: &'static str, |
| 114 | 113 | pub started_at_pat: &'static str, |
| 115 | 114 | pub chrono_hint: &'static str, |
| @@ -353,7 +352,6 @@ pub static FR: Tr = Tr { | ||
| 353 | 352 | added_pat: "{} ajouté ✓", |
| 354 | 353 | err_duration_min: "La durée doit être d'au moins 1 minute.", |
| 355 | 354 | err_cat_team: "Cette catégorie n'appartient pas à l'équipe active.", |
| 356 | - title_timer: "Minuteur", | |
| 357 | 355 | chrono_kicker: "Minuteur en cours", |
| 358 | 356 | started_at_pat: "Démarré à {}", |
| 359 | 357 | chrono_hint: "Termine le minuteur pour choisir la catégorie et enregistrer ce temps.", |
| @@ -561,7 +559,6 @@ pub static EN: Tr = Tr { | ||
| 561 | 559 | added_pat: "{} added ✓", |
| 562 | 560 | err_duration_min: "The duration must be at least 1 minute.", |
| 563 | 561 | err_cat_team: "This category does not belong to the active team.", |
| 564 | - title_timer: "Timer", | |
| 565 | 562 | chrono_kicker: "Timer running", |
| 566 | 563 | started_at_pat: "Started at {}", |
| 567 | 564 | chrono_hint: "Finish the timer to pick a category and record this time.", |
| @@ -769,7 +766,6 @@ pub static DE: Tr = Tr { | ||
| 769 | 766 | added_pat: "{} erfasst ✓", |
| 770 | 767 | err_duration_min: "Die Dauer muss mindestens 1 Minute betragen.", |
| 771 | 768 | err_cat_team: "Diese Kategorie gehört nicht zum aktiven Team.", |
| 772 | - title_timer: "Timer", | |
| 773 | 769 | chrono_kicker: "Timer läuft", |
| 774 | 770 | started_at_pat: "Gestartet um {}", |
| 775 | 771 | chrono_hint: "Beende den Timer, um eine Kategorie zu wählen und die Zeit zu erfassen.", |
| @@ -109,7 +109,6 @@ pub struct Tr { | |||
| 109 | pub err_duration_min: &'static str, | 109 | pub err_duration_min: &'static str, |
| 110 | pub err_cat_team: &'static str, | 110 | pub err_cat_team: &'static str, |
| 111 | // ─── minuteur ─── | 111 | // ─── minuteur ─── |
| 112 | - pub title_timer: &'static str, | ||
| 113 | pub chrono_kicker: &'static str, | 112 | pub chrono_kicker: &'static str, |
| 114 | pub started_at_pat: &'static str, | 113 | pub started_at_pat: &'static str, |
| 115 | pub chrono_hint: &'static str, | 114 | pub chrono_hint: &'static str, |
| @@ -353,7 +352,6 @@ pub static FR: Tr = Tr { | |||
| 353 | added_pat: "{} ajouté ✓", | 352 | added_pat: "{} ajouté ✓", |
| 354 | err_duration_min: "La durée doit être d'au moins 1 minute.", | 353 | err_duration_min: "La durée doit être d'au moins 1 minute.", |
| 355 | err_cat_team: "Cette catégorie n'appartient pas à l'équipe active.", | 354 | err_cat_team: "Cette catégorie n'appartient pas à l'équipe active.", |
| 356 | - title_timer: "Minuteur", | ||
| 357 | chrono_kicker: "Minuteur en cours", | 355 | chrono_kicker: "Minuteur en cours", |
| 358 | started_at_pat: "Démarré à {}", | 356 | started_at_pat: "Démarré à {}", |
| 359 | chrono_hint: "Termine le minuteur pour choisir la catégorie et enregistrer ce temps.", | 357 | chrono_hint: "Termine le minuteur pour choisir la catégorie et enregistrer ce temps.", |
| @@ -561,7 +559,6 @@ pub static EN: Tr = Tr { | |||
| 561 | added_pat: "{} added ✓", | 559 | added_pat: "{} added ✓", |
| 562 | err_duration_min: "The duration must be at least 1 minute.", | 560 | err_duration_min: "The duration must be at least 1 minute.", |
| 563 | err_cat_team: "This category does not belong to the active team.", | 561 | err_cat_team: "This category does not belong to the active team.", |
| 564 | - title_timer: "Timer", | ||
| 565 | chrono_kicker: "Timer running", | 562 | chrono_kicker: "Timer running", |
| 566 | started_at_pat: "Started at {}", | 563 | started_at_pat: "Started at {}", |
| 567 | chrono_hint: "Finish the timer to pick a category and record this time.", | 564 | chrono_hint: "Finish the timer to pick a category and record this time.", |
| @@ -769,7 +766,6 @@ pub static DE: Tr = Tr { | |||
| 769 | added_pat: "{} erfasst ✓", | 766 | added_pat: "{} erfasst ✓", |
| 770 | err_duration_min: "Die Dauer muss mindestens 1 Minute betragen.", | 767 | err_duration_min: "Die Dauer muss mindestens 1 Minute betragen.", |
| 771 | err_cat_team: "Diese Kategorie gehört nicht zum aktiven Team.", | 768 | err_cat_team: "Diese Kategorie gehört nicht zum aktiven Team.", |
| 772 | - title_timer: "Timer", | ||
| 773 | chrono_kicker: "Timer läuft", | 769 | chrono_kicker: "Timer läuft", |
| 774 | started_at_pat: "Gestartet um {}", | 770 | started_at_pat: "Gestartet um {}", |
| 775 | chrono_hint: "Beende den Timer, um eine Kategorie zu wählen und die Zeit zu erfassen.", | 771 | chrono_hint: "Beende den Timer, um eine Kategorie zu wählen und die Zeit zu erfassen.", |