From 66f04c5cc96ce6ae9e0fc8888554832c0ca1d281 Mon Sep 17 00:00:00 2001 From: Candifloss Date: Thu, 9 Oct 2025 15:39:00 +0530 Subject: [PATCH] Clippy fixes - Fix `cargo clippy` warnings in `query.rs` --- owm_api25/src/query.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/owm_api25/src/query.rs b/owm_api25/src/query.rs index 67fc65d..c1db86a 100644 --- a/owm_api25/src/query.rs +++ b/owm_api25/src/query.rs @@ -36,12 +36,22 @@ pub struct QueryParams { } impl QueryParams { - /// Build query URL for the `/weather` endpoint + /// Build query URL for the `/weather` endpoint. + /// + /// # Errors + /// + /// Returns an `Err` if no valid location is specified + /// (e.g., `city_id`, `city_name`, `lat`/`lon`, or `zip` are all `None`). pub fn weather_url(&self) -> Result { self.build_url(WEATHER_URL) } - /// Build query URL for the `/forecast` endpoint + /// Build query URL for the `/forecast` endpoint. + /// + /// # Errors + /// + /// Returns an `Err` if no valid location is specified + /// (e.g., `city_id`, `city_name`, `lat`/`lon`, or `zip` are all `None`). pub fn forecast_url(&self) -> Result { self.build_url(FORECAST_URL) }