diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-03-25 20:09:50 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-03-25 20:09:50 +0300 |
| commit | 0ac84bd50407f2c4747a64b5340003849439fa52 (patch) | |
| tree | f0c905c04dc6bf0c21f6bd2e067c77a8a97f536a /src/parser.rs | |
| parent | f2ef0f00b48c11f12dc49b9d1e0c27b589e78d87 (diff) | |
Fixed errors and bugs.
Diffstat (limited to 'src/parser.rs')
| -rw-r--r-- | src/parser.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/parser.rs b/src/parser.rs index 62af697..f9976e6 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -130,17 +130,24 @@ pub struct Alert { -pub fn get_location(let ip: String) -> Reslut<(), >{ +pub fn get_location(let coords_args: bool, config: &Config) -> Reslut<(), >{ //Get the lat and lon for API call - if configmanager::Config.lat.is_empty() || configmanager::Config.lon.is_empty(){ + configmanager::handle_config(); + if configmanager::Config.lat.is_empty() || configmanager::Config.lon.is_empty() && !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(<int>, <int>)`, `lon(<int>, <int>)`."); + println!("HINT: And add `lat(<int>)`, `lon(<int>)`."); println!("HINT: To get more info check https://openweathermap.org/api/one-call-3") + + Err("No coordinates in config or args.".into()) + } else { + Ok(()) } } -async pub fn parse_wheather() -> Result<(), Error>{ -} +pub async fn parse_weather(config: &Config) -> Result<(), reqwest::Error> { + + Ok(()) +}
\ No newline at end of file |
