remove two unnecessary matches
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e5307d44ca
commit
0d21d70d4a
|
@ -131,18 +131,22 @@ pub async fn get_context_route(body: Ruma<get_context::v3::Request>) -> Result<g
|
|||
}
|
||||
}
|
||||
|
||||
let shortstatehash = match services().rooms.state_accessor.pdu_shortstatehash(
|
||||
events_after
|
||||
.last()
|
||||
.map_or(&*body.event_id, |(_, e)| &*e.event_id),
|
||||
)? {
|
||||
Some(s) => s,
|
||||
None => services()
|
||||
.rooms
|
||||
.state
|
||||
.get_room_shortstatehash(&room_id)?
|
||||
.expect("All rooms have state"),
|
||||
};
|
||||
let shortstatehash = services()
|
||||
.rooms
|
||||
.state_accessor
|
||||
.pdu_shortstatehash(
|
||||
events_after
|
||||
.last()
|
||||
.map_or(&*body.event_id, |(_, e)| &*e.event_id),
|
||||
)?
|
||||
.map_or(
|
||||
services()
|
||||
.rooms
|
||||
.state
|
||||
.get_room_shortstatehash(&room_id)?
|
||||
.expect("All rooms have state"),
|
||||
|hash| hash,
|
||||
);
|
||||
|
||||
let state_ids = services()
|
||||
.rooms
|
||||
|
|
|
@ -50,22 +50,19 @@ where
|
|||
|
||||
let url = reqwest_request.url().clone();
|
||||
|
||||
let mut response = match services()
|
||||
let mut response = services()
|
||||
.globals
|
||||
.client
|
||||
.appservice
|
||||
.execute(reqwest_request)
|
||||
.await
|
||||
{
|
||||
Ok(r) => r,
|
||||
Err(e) => {
|
||||
.map_err(|e| {
|
||||
warn!(
|
||||
"Could not send request to appservice {} at {}: {}",
|
||||
registration.id, destination, e
|
||||
);
|
||||
return Err(e.into());
|
||||
},
|
||||
};
|
||||
e
|
||||
})?;
|
||||
|
||||
// reqwest::Response -> http::Response conversion
|
||||
let status = response.status();
|
||||
|
|
Loading…
Reference in New Issue