smol refactor

This commit is contained in:
Hamcha 2023-07-10 13:17:31 +02:00
parent 68c060cc97
commit 97a085d37e
Signed by: hamcha
GPG key ID: 1669C533B8CF6D89

View file

@ -83,9 +83,8 @@ impl Session {
.fetch_optional(pool)
.await?;
match record {
None => Ok(None),
Some(record) => Ok(Some((
Ok(record.map(|record| {
(
Self {
id: record.session_id,
actor: record.session_actor,
@ -105,8 +104,8 @@ impl Session {
modified_at: record.modified_at,
deleted_at: record.deleted_at,
},
))),
}
)
}))
}
pub async fn refresh(self, pool: &Pool<Postgres>, duration: Duration) -> Result<Self> {