Clippy fixes
- Fix `cargo clippy` warnings in `query.rs`
This commit is contained in:
parent
07651af450
commit
66f04c5cc9
@ -36,12 +36,22 @@ pub struct QueryParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl 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> {
|
pub fn weather_url(&self) -> Result<String, String> {
|
||||||
self.build_url(WEATHER_URL)
|
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> {
|
pub fn forecast_url(&self) -> Result<String, String> {
|
||||||
self.build_url(FORECAST_URL)
|
self.build_url(FORECAST_URL)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user