fix field naming

This commit is contained in:
Aleksandr Trushkin
2020-11-15 21:50:54 +03:00
parent a9da81a975
commit 7e700e362a

View File

@ -51,7 +51,7 @@ async fn run() {
#[derive(serde::Deserialize, Debug)] #[derive(serde::Deserialize, Debug)]
struct Climate { struct Climate {
humidity: f32, humidity: f32,
temperature: f32, temp: f32,
} }
async fn handler( async fn handler(
@ -124,7 +124,7 @@ async fn handler(
cx.answer_str(format!( cx.answer_str(format!(
"Your room temperature is {:.2} and humidity is {:.2}.", "Your room temperature is {:.2} and humidity is {:.2}.",
info.temperature, info.humidity info.temp, info.humidity
)) ))
.await? .await?
} }