aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/gitlab.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/util/gitlab.rs')
-rw-r--r--crates/shirabe/src/util/gitlab.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/crates/shirabe/src/util/gitlab.rs b/crates/shirabe/src/util/gitlab.rs
index 3938a07..86b7620 100644
--- a/crates/shirabe/src/util/gitlab.rs
+++ b/crates/shirabe/src/util/gitlab.rs
@@ -478,18 +478,14 @@ impl GitLab {
pub fn is_oauth_expired(&self, origin_url: &str) -> bool {
let auth_tokens = self.config.borrow_mut().get("gitlab-oauth");
- if let Some(map) = auth_tokens.as_array() {
- if let Some(token_info) = map.get(origin_url) {
- if let Some(token_map) = token_info.as_array() {
- if let Some(expires_at) = token_map.get("expires-at") {
- if let Some(expires_at_int) = expires_at.as_int() {
- if expires_at_int < time() {
- return true;
- }
- }
- }
- }
- }
+ if let Some(map) = auth_tokens.as_array()
+ && let Some(token_info) = map.get(origin_url)
+ && let Some(token_map) = token_info.as_array()
+ && let Some(expires_at) = token_map.get("expires-at")
+ && let Some(expires_at_int) = expires_at.as_int()
+ && expires_at_int < time()
+ {
+ return true;
}
false