1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 06:54:46 +00:00

add headers to the response (#27)

This commit is contained in:
Dominic 2021-01-14 18:37:51 +01:00
parent 3600a115d0
commit 44f3c9fe84
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
9 changed files with 48 additions and 12 deletions

View file

@ -99,6 +99,7 @@ fn errorlog<E: Display>(e: E) {
#[cfg(not(feature = "errorlog"))]
fn errorlog<E>(_e: E) {}
#[allow(deprecated)]
fn handle_error<E>(e: E) -> Pin<Box<dyn Future<Output = Result<Response, E::Err>> + Send>>
where
E: Display + IntoResponseError
@ -160,6 +161,7 @@ mod test {
struct MsgError;
#[test]
#[allow(deprecated)]
fn result_from_future() {
let nc = NoContent::default();
let res = block_on(nc.into_response()).unwrap();

View file

@ -92,6 +92,7 @@ where
}
#[cfg(test)]
#[allow(deprecated)]
mod test {
use super::*;
use futures_executor::block_on;

View file

@ -131,6 +131,7 @@ mod test {
use mime::TEXT_PLAIN;
#[test]
#[allow(deprecated)]
fn raw_response() {
let msg = "Test";
let raw = Raw::new(msg, TEXT_PLAIN);

View file

@ -49,6 +49,7 @@ where
}
#[cfg(test)]
#[allow(deprecated)]
mod test {
use super::*;
use crate::result::OrAllTypes;

View file

@ -124,6 +124,7 @@ mod test {
}
#[test]
#[allow(deprecated)]
fn success_always_successfull() {
let success: Success<Msg> = Msg::default().into();
let res = block_on(success.into_response()).expect("didn't expect error response");