Simplify return type of most route handlers

This commit is contained in:
Jonas Platte 2022-01-22 16:58:32 +01:00
parent 77a87881c9
commit 5fa9190117
No known key found for this signature in database
GPG key ID: 7D261D771D915378
38 changed files with 358 additions and 414 deletions

View file

@ -1,6 +1,6 @@
use std::sync::Arc;
use crate::{database::DatabaseGuard, pdu::PduBuilder, ConduitResult, Ruma};
use crate::{database::DatabaseGuard, pdu::PduBuilder, Result, Ruma};
use ruma::{
api::client::r0::redact::redact_event,
events::{room::redaction::RoomRedactionEventContent, EventType},
@ -17,7 +17,7 @@ use serde_json::value::to_raw_value;
pub async fn redact_event_route(
db: DatabaseGuard,
body: Ruma<redact_event::Request<'_>>,
) -> ConduitResult<redact_event::Response> {
) -> Result<redact_event::Response> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let body = body.body;
@ -53,5 +53,5 @@ pub async fn redact_event_route(
db.flush()?;
let event_id = (*event_id).to_owned();
Ok(redact_event::Response { event_id }.into())
Ok(redact_event::Response { event_id })
}