@@ -20,7 +20,8 @@ public struct WeatherQuery<T> {
2020 public static var current : WeatherQuery < CurrentWeather > {
2121 WeatherQuery < CurrentWeather > (
2222 queryType: . current( APIWeather . CodingKeys. currentWeather. rawValue) ,
23- result: { try $0. currentWeather
23+ result: {
24+ try $0. currentWeather
2425 . unwrap ( or: WeatherError . missingData ( APIWeather . CodingKeys. currentWeather. rawValue) )
2526 }
2627 )
@@ -30,7 +31,8 @@ public struct WeatherQuery<T> {
3031 public static var minute : WeatherQuery < Forecast < MinuteWeather > ? > {
3132 WeatherQuery < Forecast < MinuteWeather > ? > (
3233 queryType: . minute( APIWeather . CodingKeys. forecastNextHour. rawValue) ,
33- result: { try $0. minuteForecast
34+ result: {
35+ try $0. minuteForecast
3436 . unwrap ( or: WeatherError . missingData ( APIWeather . CodingKeys. forecastNextHour. rawValue) )
3537 }
3638 )
@@ -44,7 +46,8 @@ public struct WeatherQuery<T> {
4446 Date ( ) ,
4547 Date . hoursFromNow ( 24 )
4648 ) ,
47- result: { try $0. hourlyForecast
49+ result: {
50+ try $0. hourlyForecast
4851 . unwrap ( or: WeatherError . missingData ( APIWeather . CodingKeys. forecastHourly. rawValue) )
4952 }
5053 )
@@ -58,7 +61,8 @@ public struct WeatherQuery<T> {
5861 Date ( ) ,
5962 Date . daysFromNow ( 10 )
6063 ) ,
61- result: { try $0. dailyForecast
64+ result: {
65+ try $0. dailyForecast
6266 . unwrap ( or: WeatherError . missingData ( APIWeather . CodingKeys. forecastDaily. rawValue) )
6367 }
6468 )
@@ -67,13 +71,25 @@ public struct WeatherQuery<T> {
6771 /// The weather changes query.
6872 @available ( macOS 11 , iOS 13 , watchOS 6 , tvOS 13 , visionOS 1 , * )
6973 public static var changes : WeatherQuery < WeatherChanges ? > {
70- preconditionFailure ( )
74+ WeatherQuery < WeatherChanges ? > (
75+ queryType: . changes( APIWeather . CodingKeys. weatherChanges. rawValue) ,
76+ result: {
77+ try $0. weatherChanges
78+ . unwrap ( or: WeatherError . missingData ( APIWeather . CodingKeys. weatherChanges. rawValue) )
79+ }
80+ )
7181 }
7282
7383 /// The weather historical comparison query.
7484 @available ( macOS 11 , iOS 13 , watchOS 6 , tvOS 13 , visionOS 1 , * )
7585 public static var historicalComparisons : WeatherQuery < HistoricalComparisons ? > {
76- preconditionFailure ( )
86+ WeatherQuery < HistoricalComparisons ? > (
87+ queryType: . comparisons( APIWeather . CodingKeys. historicalComparisons. rawValue) ,
88+ result: {
89+ try $0. historicalComparisons
90+ . unwrap ( or: WeatherError . missingData ( APIWeather . CodingKeys. historicalComparisons. rawValue) )
91+ }
92+ )
7793 }
7894
7995#if canImport(CoreLocation)
0 commit comments