forked from Byron/github-star-counter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tokio
full
feature flag and cleanup
As of tokio 0.2, features are hidden behind flags. For example, macros require the `macro` feature. See tokio-rs/tokio#1833 for a more detailed description. The easiest way to stay up-to-date is by enabling the `full` feature flag, which is analog to the previous behavior. This fixes `cargo install`. Also, the `async_await` feature can be removed as it is stable since rustc 1.39.
- Loading branch information
Showing
12 changed files
with
892 additions
and
716 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use crate::request::BasicAuth; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] | ||
pub struct Repo { | ||
pub stargazers_count: usize, | ||
pub name: String, | ||
pub owner: RepoOwner, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] | ||
pub struct RepoStats { | ||
pub total: usize, | ||
pub total_by_user_only: Vec<usize>, | ||
pub total_by_orgs_only: Vec<usize>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] | ||
pub struct RepoOwner { | ||
pub login: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct User { | ||
pub login: String, | ||
pub public_repos: usize, | ||
} | ||
|
||
pub struct Options { | ||
pub no_orgs: bool, | ||
pub auth: Option<BasicAuth>, | ||
pub page_size: usize, | ||
pub repo_limit: usize, | ||
pub stargazer_threshold: usize, | ||
} | ||
|
||
impl Default for Options { | ||
fn default() -> Self { | ||
Self { | ||
auth: None, | ||
no_orgs: false, | ||
page_size: 100, | ||
repo_limit: 10, | ||
stargazer_threshold: 0, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Response { | ||
pub user: User, | ||
pub repos: Vec<Repo>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.