Clear clippy findings surfaced by the layer split
Browse files at this commit6562e608dcaa169afb4903503f61c4582bbb5235Parent: 3321736- chore
- clear clippy findings surfaced by the layer split
5 changed files +10 -4
- src/db/board_stroke.rs +0 -1
- src/service/exam.rs +4 -0
- src/service/user.rs +4 -0
- src/web/mod.rs +1 -2
- tests/ai_bridge.rs +1 -1
src/db/board_stroke.rsmodified+0 -1
| @@ -82,7 +82,6 @@ pub async fn append( | |||
| 82 | /// The one place `closed` is ordered above `locked` lives in | 82 | /// The one place `closed` is ordered above `locked` lives in |
| 83 | /// [`state_refusal`]; both refusal paths re-read the board and | 83 | /// [`state_refusal`]; both refusal paths re-read the board and |
| 84 | /// ask it. | 84 | /// ask it. |
| 85 | - | ||
| 86 | async fn why_refused(db: &Database, board: &BoardId) -> Result<AppError, AppError> { | 85 | async fn why_refused(db: &Database, board: &BoardId) -> Result<AppError, AppError> { |
| 87 | let board = crate::db::board::read(db, board) | 86 | let board = crate::db::board::read(db, board) |
| 88 | .await? | 87 | .await? |
src/service/exam.rsmodified+4 -0
| @@ -23,6 +23,10 @@ use crate::error::AppError; | |||
| 23 | use crate::service::course::require_open; | 23 | use crate::service::course::require_open; |
| 24 | use crate::service::exam_attempt::{EXAM_LOCK, any_for_exam, course_of}; | 24 | use crate::service::exam_attempt::{EXAM_LOCK, any_for_exam, course_of}; |
| 25 | 25 | ||
| 26 | +#[expect( | ||
| 27 | + clippy::too_many_arguments, | ||
| 28 | + reason = "mirrors the sibling entities' create(field, field, ..) shape" | ||
| 29 | +)] | ||
| 26 | pub async fn create( | 30 | pub async fn create( |
| 27 | db: &Database, | 31 | db: &Database, |
| 28 | creator: &UserId, | 32 | creator: &UserId, |
src/service/user.rsmodified+4 -0
| @@ -171,6 +171,10 @@ pub async fn find_by_username(db: &Database, username: &str) -> Result<Option<Us | |||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | /// Persist the personal-info/profile fields a PATCH carried. | 173 | /// Persist the personal-info/profile fields a PATCH carried. |
| 174 | +// One argument per nullable column is the point: folding them into a struct | ||
| 175 | +// would just re-spell the HTTP DTO here and cost the compiler's check that | ||
| 176 | +// every column was considered at the call site. | ||
| 177 | +#[allow(clippy::too_many_arguments)] | ||
| 174 | pub async fn set_profile( | 178 | pub async fn set_profile( |
| 175 | db: &Database, | 179 | db: &Database, |
| 176 | id: &UserId, | 180 | id: &UserId, |
src/web/mod.rsmodified+1 -2
| @@ -395,8 +395,7 @@ mod tests { | |||
| 395 | .unwrap(); | 395 | .unwrap(); |
| 396 | crate::service::user::set_role(&db, teacher.get_id(), Role::Teacher) | 396 | crate::service::user::set_role(&db, teacher.get_id(), Role::Teacher) |
| 397 | .await | 397 | .await |
| 398 | - .unwrap() | 398 | + .unwrap(); |
| 399 | - .0; | ||
| 400 | let assigned = async |db: &Database| { | 399 | let assigned = async |db: &Database| { |
| 401 | let class = crate::service::class_group::create( | 400 | let class = crate::service::class_group::create( |
| 402 | db, | 401 | db, |
tests/ai_bridge.rsmodified+1 -1
| @@ -1722,7 +1722,7 @@ use hezarfen_backend::domain::rag_output::RagOutput; | |||
| 1722 | 1722 | ||
| 1723 | /// Every stored output of `note`, newest first. | 1723 | /// Every stored output of `note`, newest first. |
| 1724 | async fn outputs(db: &Database, note: &str) -> Vec<RagOutput> { | 1724 | async fn outputs(db: &Database, note: &str) -> Vec<RagOutput> { |
| 1725 | - hezarfen_backend::db::rag_output::list_for(&db, &CourseNoteId::from_key(note), None, 0) | 1725 | + hezarfen_backend::db::rag_output::list_for(db, &CourseNoteId::from_key(note), None, 0) |
| 1726 | .await | 1726 | .await |
| 1727 | .expect("list rag outputs") | 1727 | .expect("list rag outputs") |
| 1728 | .0 | 1728 | .0 |