diff options
| author | Fuwn <[email protected]> | 2021-05-06 19:57:40 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-06 19:57:40 -0700 |
| commit | f0a1f7f9ee3e89da8ccacb92cc7cd999b921d59e (patch) | |
| tree | 2f50f25619aff2b10131c2ae01061f0fd03f2d3c /src | |
| parent | fix(utils): no timeout on request, implements safe guards against rate-limiting (diff) | |
| download | api-worker-f0a1f7f9ee3e89da8ccacb92cc7cd999b921d59e.tar.xz api-worker-f0a1f7f9ee3e89da8ccacb92cc7cd999b921d59e.zip | |
fix(utils): more safe-guards
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs index b4672e0..ac1b51d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -24,14 +24,14 @@ pub async fn github_api() -> Result<GitHubAPIResponse, Box<dyn std::error::Error .json::<GitHubAPIResponse>() .limit(20_000_000) .await - .unwrap(), + .unwrap_or_default(), ) } pub async fn filter_languages() -> Vec<String> { let mut languages = vec![]; - for i in github_api().await.unwrap_or_default().tree { + for i in github_api().await.unwrap().tree { if i._type == "tree" { languages.push(i.path); } |