From d646b8f8508dc9a0d6e6ceee4a9386a448eba839 Mon Sep 17 00:00:00 2001 From: ArcaneDev Date: Wed, 26 Mar 2025 22:38:41 +0300 Subject: Update parser.rs --- src/parser.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parser.rs b/src/parser.rs index e97db13..d6b7abd 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -138,6 +138,12 @@ pub fn get_location(coords_args: bool) -> Result<(), BoxedError> { .clone(); if (config.lat == 0.0 || config.lon == 0.0) && !coords_args { + + println!("No coordinates in configuration file or conf not founded."); + println!("HINT: Try create ~/.config/WeatherFetch/Config.toml"); + println!("HINT: And add `lat()`, `lon()`."); + println!("HINT: To get more info check https://openweathermap.org/api/one-call-3"); + Err("Invalid coordinates in config".into()) } else { Ok(()) @@ -165,4 +171,4 @@ pub async fn parse_weather() -> Result> let weather_data: WeatherData = response.json().await?; Ok(weather_data) -} \ No newline at end of file +} -- cgit v1.2.3