summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-03-25 22:20:05 +0300
committerNamilskyy <alive6863@gmail.com>2025-03-25 22:20:26 +0300
commite687e9bd48ce383894fd499595fc25c2dd8ca024 (patch)
tree45fb75296303dabe37f938d8f46e02c707eba485 /src/parser.rs
parentb581af3a76cba646ec58776fcfcca5821bf56221 (diff)
Fixed errors and bugs.
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/parser.rs b/src/parser.rs
index f9976e6..e8eff39 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1,13 +1,8 @@
use reqwest::{Error, Client, get};
use chrono::{DateTime, Utc, prelude::*};
-use serde::{Serialize, Deserealize};
-use std::net::{IpAddr, SocketAddr, UpdSocket};
+use serde::{Serialize, Deserialize};
-mod configmanager;
-
-use configmanager::*;
-
-static ErrBuff: String = reqwest::Error;
+use crate::configmanager::{Config};
//API answer struct`s
#[derive(Debug, Serialize, Deserialize)]
@@ -130,15 +125,15 @@ pub struct Alert {
-pub fn get_location(let coords_args: bool, config: &Config) -> Reslut<(), >{
+pub fn get_location(let coords_args: bool, config: &Config) -> Result<(), String>{
//Get the lat and lon for API call
configmanager::handle_config();
- if configmanager::Config.lat.is_empty() || configmanager::Config.lon.is_empty() && !coords_args{
+ if Config.lat.is_empty() || 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>)`, `lon(<int>)`.");
- println!("HINT: To get more info check https://openweathermap.org/api/one-call-3")
-
+ println!("HINT: To get more info check https://openweathermap.org/api/one-call-3");
+
Err("No coordinates in config or args.".into())
} else {
Ok(())
@@ -146,8 +141,6 @@ pub fn get_location(let coords_args: bool, config: &Config) -> Reslut<(), >{
}
-
-pub async fn parse_weather(config: &Config) -> Result<(), reqwest::Error> {
-
+pub async fn parse_weather(_config: &Config) -> Result<(), reqwest::Error> {
Ok(())
-} \ No newline at end of file
+}