use crate::ip_api::ip_location::IpLocation; pub fn extract_coords_and_city(ip: &str) -> Result { 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) }