1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-05-09 16:10:42 +00:00

track gotham master

This commit is contained in:
Dominic 2021-02-28 01:59:59 +01:00
parent bb6f5b0fdd
commit 960ba0e8bc
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
2 changed files with 7 additions and 7 deletions

View file

@ -10,7 +10,7 @@ use gotham::{
use gotham_restful::*;
use mime::{APPLICATION_JSON, TEXT_PLAIN};
use serde::Deserialize;
use tokio::time::{delay_for, Duration};
use tokio::time::{sleep, Duration};
mod util {
include!("util/mod.rs");
@ -86,9 +86,9 @@ async fn remove(_id: u64) -> Raw<&'static [u8]> {
const STATE_TEST_RESPONSE: &[u8] = b"xxJbxOuwioqR5DfzPuVqvaqRSfpdNQGluIvHU4n1LM";
#[endpoint(method = "Method::GET", uri = "state_test")]
async fn state_test(state: &mut State) -> Raw<&'static [u8]> {
delay_for(Duration::from_nanos(1)).await;
sleep(Duration::from_nanos(1)).await;
state.borrow::<HeaderMap>();
delay_for(Duration::from_nanos(1)).await;
sleep(Duration::from_nanos(1)).await;
Raw::new(STATE_TEST_RESPONSE, TEXT_PLAIN)
}