Clippy fixes

- Fix `cargo clippy` warnings in `query.rs`
This commit is contained in:
Candifloss 2025-10-09 15:39:00 +05:30
parent 07651af450
commit 66f04c5cc9

View File

@ -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<String, String> {
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<String, String> {
self.build_url(FORECAST_URL)
}