From 65b2c38c29521ece805c5f794492ce25d484c76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gali=C4=87?= Date: Mon, 17 Feb 2020 23:14:28 +0100 Subject: [PATCH] .await? result from read_to_string() --- src/inbox.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/inbox.rs b/src/inbox.rs index 652da310..92dba541 100644 --- a/src/inbox.rs +++ b/src/inbox.rs @@ -9,7 +9,6 @@ use plume_models::{ use rocket::{data::*, http::Status, response::status, Outcome::*, Request}; use rocket_contrib::json::*; use serde::Deserialize; -use std::io::Read; use tokio::io::AsyncReadExt; pub fn handle_incoming( @@ -78,7 +77,7 @@ impl<'a, T: Deserialize<'a>> FromData<'a> for SignedJson { Box::pin(async move { let size_limit = r.limits().get("json").unwrap_or(JSON_LIMIT); let mut s = String::with_capacity(512); - let outcome = match d.open().take(size_limit).read_to_string(&mut s) { + let outcome = match d.open().take(size_limit).read_to_string(&mut s).await { Ok(_) => Success(s), Err(e) => Failure((Status::BadRequest, JsonError::Io(e))), };