Remove unnecessary Result

This commit is contained in:
Jonas Platte 2022-01-19 23:56:55 +01:00
parent c6277c72a1
commit a0fc5eba72
No known key found for this signature in database
GPG key ID: 7D261D771D915378
2 changed files with 8 additions and 12 deletions

View file

@ -166,13 +166,12 @@ impl Uiaa {
user_id: &UserId, user_id: &UserId,
device_id: &DeviceId, device_id: &DeviceId,
session: &str, session: &str,
) -> Result<Option<CanonicalJsonValue>> { ) -> Option<CanonicalJsonValue> {
Ok(self self.userdevicesessionid_uiaarequest
.userdevicesessionid_uiaarequest
.read() .read()
.unwrap() .unwrap()
.get(&(user_id.to_owned(), device_id.to_owned(), session.to_owned())) .get(&(user_id.to_owned(), device_id.to_owned(), session.to_owned()))
.map(|j| j.to_owned())) .map(|j| j.to_owned())
} }
fn update_uiaa_session( fn update_uiaa_session(

View file

@ -296,14 +296,11 @@ where
.and_then(|auth| auth.get("session")) .and_then(|auth| auth.get("session"))
.and_then(|session| session.as_str()) .and_then(|session| session.as_str())
.and_then(|session| { .and_then(|session| {
db.uiaa db.uiaa.get_uiaa_request(
.get_uiaa_request( &user_id,
&user_id, &sender_device.clone().unwrap_or_else(|| "".into()),
&sender_device.clone().unwrap_or_else(|| "".into()), session,
session, )
)
.ok()
.flatten()
}) })
{ {
for (key, value) in initial_request { for (key, value) in initial_request {