diff options
| author | Fuwn <[email protected]> | 2021-05-06 19:53:51 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-06 19:53:51 +0000 |
| commit | ad03092b4107735cd57c14d43e6afbe3d7eaff68 (patch) | |
| tree | 6532ba561154b90df46ee9ee906f04e7fab131de /src/structures.rs | |
| parent | fix(structures): remove random create pub (diff) | |
| download | api-ad03092b4107735cd57c14d43e6afbe3d7eaff68.tar.xz api-ad03092b4107735cd57c14d43e6afbe3d7eaff68.zip | |
fix(utils): no timeout on request, implements safe guards against rate-limiting
Diffstat (limited to 'src/structures.rs')
| -rw-r--r-- | src/structures.rs | 10 |
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 { |