extern crate openweather;
use openweather::LocationSpecifier;
static API_KEY: &str = "e85e0a3142231dab28a2611888e48f22";
fn main() {
let loc = LocationSpecifier::Coordinates {
lat: 24.87,
lon: 67.03,
};
let weather = openweather::get_current_weather(loc, API_KEY).unwrap();
print!(
"Right now in Minneapolis, MN it is {}K",
weather.main.humidity
);
}
错误:线程'main'在'调用
Result::unwrap()
一个Err
值时惊慌失措:ErrorReport { cod:0,消息:“得到意外响应:\”{\\“coord\\”:{\\“lon\\”:67.03,\ \"lat\\":24.87},\\"weather\\":[{\\"id\\":803,\\"main\\":\\"Clouds\\",\\"说明\\":\\"破云\\",\\"图标\\":\\"04n\\"}],\\"基地\\":\\"车站\\",\\" main\\":{\\"temp\\":294.15,\\"压力\\":1018,\\"湿度\\":60,\\"temp_min\\":294.15,\\"temp_max \\":294.15},\\"能见度\\":6000,\\"风\\":{\\"速度\\":5.1,\\"度数\\":30},\\"云\\":{\\"所有\\":70},\\"dt\\":1574012543,\\"sys\\":{\\"type\\":1,\\"id\\":7576,\\"country\\":\\"PK\\",\\"sunrise\\": 1573955364,\\"日落\\":1573994659},\\"时区\\":18000,\\"id\\":1174872,\\"姓名\\":\\"卡拉奇\\",\ \"鳕鱼\\":200}\"" }