async simplification

main
HeNine 2 years ago
parent 682cc972d5
commit e6a49851fe

@ -49,7 +49,7 @@ impl Into<State> for u8 {
} }
} }
async fn send_status( fn send_status(
rule: u8, rule: u8,
states: String, states: String,
) -> impl Future<Output = Result<reqwest::Response, reqwest::Error>> { ) -> impl Future<Output = Result<reqwest::Response, reqwest::Error>> {
@ -118,7 +118,7 @@ async fn main() {
// Send toot // Send toot
let sent = let sent =
tokio::time::timeout(Duration::from_secs(1), send_status(rule, states).await).await; tokio::time::timeout(Duration::from_secs(1), send_status(rule, states)).await;
// Figure out what went wrong // Figure out what went wrong
match sent { match sent {

Loading…
Cancel
Save