Conditionally emit rocket::http_verb attr macros if lib/bin

This commit is contained in:
Devin Ragotzy
2020-07-25 23:08:00 -04:00
committed by timokoesters
parent b82fd02ee3
commit 42e0102a2a
8 changed files with 453 additions and 170 deletions

View File

@@ -1,16 +1,18 @@
use crate::RumaResponse;
use http::StatusCode;
use log::error;
use rocket::{
response::{self, Responder},
Request,
};
use ruma::api::client::{
error::{Error as RumaError, ErrorKind},
r0::uiaa::{UiaaInfo, UiaaResponse},
};
use ruma::api::client::{error::ErrorKind, r0::uiaa::UiaaInfo};
use thiserror::Error;
#[cfg(feature = "conduit_bin")]
use {
crate::RumaResponse,
http::StatusCode,
rocket::{
response::{self, Responder},
Request,
},
ruma::api::client::{error::Error as RumaError, r0::uiaa::UiaaResponse},
};
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
@@ -46,6 +48,7 @@ impl Error {
}
}
#[cfg(feature = "conduit_bin")]
impl<'r, 'o> Responder<'r, 'o> for Error
where
'o: 'r,