aboutsummaryrefslogtreecommitdiff
path: root/src/structures.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-06 19:53:51 -0700
committerFuwn <[email protected]>2021-05-06 19:53:51 -0700
commitbbcdbd58ee717c7dc53ccb970b2c8746c8e54196 (patch)
tree6532ba561154b90df46ee9ee906f04e7fab131de /src/structures.rs
parentfix(structures): remove random create pub (diff)
downloadapi-worker-bbcdbd58ee717c7dc53ccb970b2c8746c8e54196.tar.xz
api-worker-bbcdbd58ee717c7dc53ccb970b2c8746c8e54196.zip
fix(utils): no timeout on request, implements safe guards against rate-limiting
Diffstat (limited to 'src/structures.rs')
-rw-r--r--src/structures.rs10
1 files changed, 10 insertions, 0 deletions
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<GitHubAPIResponseTree>,
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 {