mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-27 11:42:46 +00:00
refactor: appease clippy
This commit is contained in:
parent
d841b81c56
commit
4c06f329c4
@ -1618,7 +1618,7 @@ pub async fn sync_events_v4_route(
|
||||
.rooms
|
||||
.state_accessor
|
||||
.get_name(room_id)?
|
||||
.or_else(|| name),
|
||||
.or(name),
|
||||
avatar: if let Some(avatar) = avatar {
|
||||
ruma::JsOption::Some(avatar)
|
||||
} else {
|
||||
|
@ -966,14 +966,21 @@ impl Service {
|
||||
|
||||
debug!("Resolving state");
|
||||
|
||||
let lock = services().globals.stateres_mutex.lock();
|
||||
let state = match state_res::resolve(room_version_id, &fork_states, auth_chain_sets, |id| {
|
||||
let fetch_event = |id: &_| {
|
||||
let res = services().rooms.timeline.get_pdu(id);
|
||||
if let Err(e) = &res {
|
||||
error!("LOOK AT ME Failed to fetch event: {}", e);
|
||||
}
|
||||
res.ok().flatten()
|
||||
}) {
|
||||
};
|
||||
|
||||
let lock = services().globals.stateres_mutex.lock();
|
||||
let state = match state_res::resolve(
|
||||
room_version_id,
|
||||
&fork_states,
|
||||
auth_chain_sets,
|
||||
fetch_event,
|
||||
) {
|
||||
Ok(new_state) => new_state,
|
||||
Err(_) => {
|
||||
return Err(Error::bad_database("State resolution failed, either an event could not be found or deserialization"));
|
||||
|
@ -133,8 +133,7 @@ impl Service {
|
||||
.ok_or_else(|| Error::bad_database("Event in space state not found"))?;
|
||||
|
||||
if serde_json::from_str::<SpaceChildEventContent>(pdu.content.get())
|
||||
.ok()
|
||||
.and_then(|c| Some(c.via))
|
||||
.ok().map(|c| c.via)
|
||||
.map_or(true, |v| v.is_empty())
|
||||
{
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user