Simplify return type of most route handlers
This commit is contained in:
parent
77a87881c9
commit
5fa9190117
38 changed files with 358 additions and 414 deletions
|
@ -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 })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue