diff --git a/fractal-matrix-api/src/backend/room.rs b/fractal-matrix-api/src/backend/room.rs index 4d7e139f..552c3846 100644 --- a/fractal-matrix-api/src/backend/room.rs +++ b/fractal-matrix-api/src/backend/room.rs @@ -575,7 +575,9 @@ pub fn direct_chat(bk: &Backend, user: Member, internal_id: String) -> Result<() let directs = &mut data.lock().unwrap().m_direct; if directs.contains_key(&m.uid) { - directs.get_mut(&m.uid).map(|v| v.push(id.clone())); + if let Some(v) = directs.get_mut(&m.uid) { + v.push(id.clone()) + }; } else { directs.insert(m.uid.clone(), vec![id.clone()]); } diff --git a/fractal-matrix-api/src/util.rs b/fractal-matrix-api/src/util.rs index ec4b6198..b97d6029 100644 --- a/fractal-matrix-api/src/util.rs +++ b/fractal-matrix-api/src/util.rs @@ -241,9 +241,9 @@ pub fn get_rooms_from_json(r: &JsonValue, userid: &str, baseu: &Url) -> Result