Correct stdout, updating lib and some clippy clean
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-07-30 18:13:42 +02:00
parent fd4affdb17
commit 1affcb9d1a
10 changed files with 117 additions and 138 deletions
+9
View File
@@ -0,0 +1,9 @@
use crate::ip_api::ip_location::IpLocation;
pub fn extract_coords_and_city(ip: &str) -> Result<IpLocation, ureq::Error> {
let url = format!("http://ip-api.com/json/{}?fields=16592", ip);
let body: serde_json::Value = ureq::get(&url).call()?.into_json()?;
let current_weather: IpLocation = serde_json::from_value(body).unwrap();
Ok(current_weather)
}