forge
Explore
Log in

Don't you dare go Hollow

Apply cargo fmt to settings and attendance tests

Browse files at this commit

9d57d6aa43500074b8ceb6c9079516f2fbfa5853Ahmet Kaan GümüşParent: caa814c
  • style
    • apply cargo fmt to settings and attendance tests
Show full message
🎨 style: apply cargo fmt to settings and attendance tests
src/domain/attendance.rsmodified+3 -1
@@ -159,7 +159,9 @@ mod tests {
159159 .to_vec();
160160 for status in ["present", "absent", "late", "excused"] {
161161 assert_eq!(
162- AttendanceStatus::try_new(status, &allowed).unwrap().as_str(),
162+ AttendanceStatus::try_new(status, &allowed)
163+ .unwrap()
164+ .as_str(),
163165 status
164166 );
165167 }
src/domain/settings.rsmodified+10 -9
@@ -176,10 +176,7 @@ impl Settings {
176176
177177 /// Shared rules for the editable string lists: 1–20 trimmed, non-empty,
178178 /// ≤50-char entries with no case-insensitive duplicates.
179-fn validate_list(
180- field: &'static str,
181- values: Vec<String>,
182-) -> Result<Vec<String>, ValidationError> {
179+fn validate_list(field: &'static str, values: Vec<String>) -> Result<Vec<String>, ValidationError> {
183180 if values.is_empty() {
184181 return Err(ValidationError::Empty(field));
185182 }
@@ -315,11 +312,15 @@ mod tests {
315312 // Save a custom policy and read it back — bands (nested objects under
316313 // a FLEXIBLE field) must survive the trip.
317314 let statuses = Settings::defaults().get_attendance_statuses().to_vec();
318- Settings::try_new(kinds(&["lab"]), statuses.clone(), bands(&[(0, "F"), (50, "P")]))
319- .unwrap()
320- .save(&db)
321- .await
322- .unwrap();
315+ Settings::try_new(
316+ kinds(&["lab"]),
317+ statuses.clone(),
318+ bands(&[(0, "F"), (50, "P")]),
319+ )
320+ .unwrap()
321+ .save(&db)
322+ .await
323+ .unwrap();
323324 let loaded = Settings::load(&db).await.unwrap();
324325 assert_eq!(loaded.get_exam_kinds(), ["lab"]);
325326 assert_eq!(loaded.get_grade_bands().len(), 2);