Make Result alias usable with any error type

This commit is contained in:
Jonas Platte 2021-10-13 11:56:46 +02:00
parent f2ef5677e0
commit 91afa1e0e0
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
5 changed files with 13 additions and 15 deletions

View file

@ -60,7 +60,7 @@ use rocket::{get, tokio};
pub async fn sync_events_route(
db: DatabaseGuard,
body: Ruma<sync_events::Request<'_>>,
) -> std::result::Result<RumaResponse<sync_events::Response>, RumaResponse<UiaaResponse>> {
) -> Result<RumaResponse<sync_events::Response>, RumaResponse<UiaaResponse>> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let sender_device = body.sender_device.as_ref().expect("user is authenticated");
@ -182,7 +182,7 @@ async fn sync_helper(
full_state: bool,
timeout: Option<Duration>,
// bool = caching allowed
) -> std::result::Result<(sync_events::Response, bool), Error> {
) -> Result<(sync_events::Response, bool), Error> {
// TODO: match body.set_presence {
db.rooms.edus.ping_presence(&sender_user)?;