aboutsummaryrefslogtreecommitdiffstats
path: root/src/github.rs
diff options
context:
space:
mode:
authorTeddy Wing2021-05-30 19:20:08 +0200
committerTeddy Wing2021-05-30 19:20:08 +0200
commit7c046b3e9531b9dd71df06ef7381f9ccc086d1a7 (patch)
tree6045014b025acd4f8f22712eb724517588ca5e23 /src/github.rs
parenta340db978034715823eaadd005d2627815aed4ea (diff)
downloadreflectub-7c046b3e9531b9dd71df06ef7381f9ccc086d1a7.tar.bz2
github::fetch_repos(): Extract username to function argument
Diffstat (limited to 'src/github.rs')
-rw-r--r--src/github.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/github.rs b/src/github.rs
index 0f4de77..bcd9865 100644
--- a/src/github.rs
+++ b/src/github.rs
@@ -42,7 +42,7 @@ impl Repo {
/// Fetch all GitHub repositories for the given user.
-pub async fn fetch_repos() -> Result<Vec<Repo>, Error> {
+pub async fn fetch_repos(github_username: &str) -> Result<Vec<Repo>, Error> {
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Accept", "application/vnd.github.v3+json".parse()?);
@@ -58,7 +58,7 @@ pub async fn fetch_repos() -> Result<Vec<Repo>, Error> {
reqwest::Method::GET,
format!(
"https://api.github.com/users/{}/repos?page={}&per_page=100",
- "teddywing",
+ github_username,
i,
),
)