1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
This commit is contained in:
Rob Ede 2022-12-18 17:48:09 +00:00
parent 4df66d1e8a
commit 43d26f194d
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
3 changed files with 4 additions and 3 deletions

View File

@ -50,7 +50,7 @@ pub fn send_invitation(invitation: &Invitation) -> Result<(), ServiceError> {
match result { match result {
Ok(res) => match res { Ok(res) => match res {
TransmissionResponse::ApiResponse(api_res) => { TransmissionResponse::ApiResponse(api_res) => {
println!("API Response: \n {:#?}", api_res); println!("API Response: \n {api_res:#?}");
Ok(()) Ok(())
} }
TransmissionResponse::ApiError(errors) => { TransmissionResponse::ApiError(errors) => {
@ -59,7 +59,7 @@ pub fn send_invitation(invitation: &Invitation) -> Result<(), ServiceError> {
} }
}, },
Err(error) => { Err(error) => {
println!("Send Email Error: \n {:#?}", error); println!("Send Email Error: \n {error:#?}");
Err(ServiceError::InternalServerError) Err(ServiceError::InternalServerError)
} }
} }

View File

@ -10,7 +10,7 @@ pub enum ServiceError {
#[display(fmt = "Internal Server Error")] #[display(fmt = "Internal Server Error")]
InternalServerError, InternalServerError,
#[display(fmt = "BadRequest: {}", _0)] #[display(fmt = "BadRequest: {_0}")]
BadRequest(String), BadRequest(String),
#[display(fmt = "Unauthorized")] #[display(fmt = "Unauthorized")]

View File

@ -59,6 +59,7 @@ impl StopHandle {
/// Sends stop signal through contained server handle. /// Sends stop signal through contained server handle.
pub(crate) fn stop(&self, graceful: bool) { pub(crate) fn stop(&self, graceful: bool) {
#[allow(clippy::let_underscore_future)]
let _ = self.inner.lock().as_ref().unwrap().stop(graceful); let _ = self.inner.lock().as_ref().unwrap().stop(graceful);
} }
} }