diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-03-26 14:49:15 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-03-26 14:49:15 +0300 |
| commit | c214e1c59e54b895e32c332afc6bb8e897b01d0e (patch) | |
| tree | 449c7c4c4ed02c72469a7bd22b3cb1bc3b8b133c /src/parser.rs | |
| parent | e687e9bd48ce383894fd499595fc25c2dd8ca024 (diff) | |
Fixing errs
Diffstat (limited to 'src/parser.rs')
| -rw-r--r-- | src/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser.rs b/src/parser.rs index e8eff39..5a670b1 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -2,7 +2,7 @@ use reqwest::{Error, Client, get}; use chrono::{DateTime, Utc, prelude::*}; use serde::{Serialize, Deserialize}; -use crate::configmanager::{Config}; +use crate::configmanager; //API answer struct`s #[derive(Debug, Serialize, Deserialize)] @@ -125,10 +125,10 @@ pub struct Alert { -pub fn get_location(let coords_args: bool, config: &Config) -> Result<(), String>{ +pub fn get_location(coords_args: bool) -> Result<(), String>{ //Get the lat and lon for API call - configmanager::handle_config(); - if Config.lat.is_empty() || Config.lon.is_empty() && !coords_args{ + let conf: Option<configmanager::load()>; + if conf.lat.is_empty() || conf.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>)`, `lon(<int>)`."); |
