smol refactor
This commit is contained in:
parent
68c060cc97
commit
97a085d37e
1 changed files with 4 additions and 5 deletions
|
@ -83,9 +83,8 @@ impl Session {
|
||||||
.fetch_optional(pool)
|
.fetch_optional(pool)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
match record {
|
Ok(record.map(|record| {
|
||||||
None => Ok(None),
|
(
|
||||||
Some(record) => Ok(Some((
|
|
||||||
Self {
|
Self {
|
||||||
id: record.session_id,
|
id: record.session_id,
|
||||||
actor: record.session_actor,
|
actor: record.session_actor,
|
||||||
|
@ -105,8 +104,8 @@ impl Session {
|
||||||
modified_at: record.modified_at,
|
modified_at: record.modified_at,
|
||||||
deleted_at: record.deleted_at,
|
deleted_at: record.deleted_at,
|
||||||
},
|
},
|
||||||
))),
|
)
|
||||||
}
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn refresh(self, pool: &Pool<Postgres>, duration: Duration) -> Result<Self> {
|
pub async fn refresh(self, pool: &Pool<Postgres>, duration: Duration) -> Result<Self> {
|
||||||
|
|
Loading…
Reference in a new issue