Moved test database teardown into defer blocks and unified the one-decimal formatting in the Website service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javierandClaude Opus 5.5 committed 2026-10-25 12:41:55 +01:00
1 parent 06953a1be0
commit e0524da525
16 files changed
+118 -146

No files matched your search

@@ -18,7 +18,7 @@ extension Listing {
}
return (
"\(grader) \(grade.gradeLabel)",
"\(grader) \(grade.oneDecimal)",
grade >= 9 ? .good : grade < 7 ? .warn : .neutral,
true
)
@@ -72,7 +72,7 @@ extension Shop {
/// The shop's standing in a line: where it is, since when, and how it is rated.
var standing: String {
"\(location) · selling on CCN since \(sinceYear) · \(rating.formatted(.number.precision(.fractionLength(1)).locale(.init(identifier: "en")))) from \(ratedSales) rated sales"
"\(location) · selling on CCN since \(sinceYear) · \(rating.oneDecimal) from \(ratedSales) rated sales"
}
}
@@ -81,8 +81,8 @@ extension Double {
// MARK: Computed
/// The grade to one decimal place, e.g. `9.8`.
var gradeLabel: String {
/// The number to one decimal place, e.g. `9.8`.
var oneDecimal: String {
formatted(.number.precision(.fractionLength(1)).locale(.init(identifier: "en")))
}