From 7c046b3e9531b9dd71df06ef7381f9ccc086d1a7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 30 May 2021 19:20:08 +0200 Subject: github::fetch_repos(): Extract username to function argument --- src/github.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/github.rs') 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, Error> { +pub async fn fetch_repos(github_username: &str) -> Result, 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, Error> { reqwest::Method::GET, format!( "https://api.github.com/users/{}/repos?page={}&per_page=100", - "teddywing", + github_username, i, ), ) -- cgit v1.2.3