From 09e8df6d652d87d04b75d0bbea8f5e7494df991c Mon Sep 17 00:00:00 2001 Message-Id: <09e8df6d652d87d04b75d0bbea8f5e7494df991c.1638101267.git.avityazev@posteo.org> In-Reply-To: References: From: Aleksandr Vityazev Date: Sun, 28 Nov 2021 14:46:18 +0300 Subject: [PATCH 10/11] * oauth2 (oauth2--created-at): Use if-let. --- oauth2.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/oauth2.el b/oauth2.el index 9906e8a..49a12bc 100644 --- a/oauth2.el +++ b/oauth2.el @@ -120,9 +120,10 @@ Return the code provided by the service." "Return epoch time from RESPONSE. If there no created_at key in RESPONSE, add \(cons 'created_at . epoch-time\) to RESPONSE." - (let ((it (cdr (assoc 'created_at response)))) - (if it it (prog1 (oauth2--epoch-time) - (cl-pushnew (cons 'created_at (oauth2--epoch-time)) response))))) + (if-let ((it (cdr (assoc 'created_at response)))) + it + (prog1 (oauth2--epoch-time) + (cl-pushnew (cons 'created_at (oauth2--epoch-time)) response)))) (cl-defun oauth2-request-access (token-url client-id client-secret code &optional (redirect-uri "urn:ietf:wg:oauth:2.0:oob")) -- 2.34.0