Skip to content

Commit

Permalink
.await? result from read_to_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
igalic committed Feb 17, 2020
1 parent 86d03b2 commit b56ad50
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/inbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -78,7 +77,7 @@ impl<'a, T: Deserialize<'a>> FromData<'a> for SignedJson<T> {
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 = d.open().take(size_limit).read_to_string(&mut s).await? {
Ok(_) => Success(s),
Err(e) => Failure((Status::BadRequest, JsonError::Io(e))),
};
Expand Down

0 comments on commit b56ad50

Please sign in to comment.