From bbcdbd58ee717c7dc53ccb970b2c8746c8e54196 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 6 May 2021 19:53:51 -0700 Subject: fix(utils): no timeout on request, implements safe guards against rate-limiting --- src/structures.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/structures.rs') diff --git a/src/structures.rs b/src/structures.rs index 13f904d..0e9f227 100644 --- a/src/structures.rs +++ b/src/structures.rs @@ -10,6 +10,16 @@ pub struct GitHubAPIResponse { pub tree: Vec, pub truncated: bool, } +impl Default for GitHubAPIResponse { + fn default() -> Self { + GitHubAPIResponse { + sha: "rate limited".to_string(), + url: "rate limited".to_string(), + tree: vec![], + truncated: false, + } + } +} #[derive(Serialize, Deserialize, Debug)] pub struct GitHubAPIResponseTree { -- cgit v1.2.3