From 5c747f2b411bb2c08c356a82c58ef63d2b586f70 Mon Sep 17 00:00:00 2001 From: DenebTM Date: Sun, 11 Feb 2024 19:04:53 +0100 Subject: [PATCH] slightly shorten db.get_token (no good reason other than i think it looks better) --- src/db.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/db.rs b/src/db.rs index 8dacbd6..d28451b 100644 --- a/src/db.rs +++ b/src/db.rs @@ -98,12 +98,9 @@ impl Database for SqliteDatabase { valid, created, last_used, - }| { - if valid { - UserTokenEntry::Valid(UserToken::from(token), created, last_used) - } else { - UserTokenEntry::Invalid(UserToken::from(token), created, last_used) - } + }| match valid { + true => UserTokenEntry::Valid(UserToken::from(token), created, last_used), + false => UserTokenEntry::Invalid(UserToken::from(token), created, last_used), }, )) }