Skip to content

Commit 488642c

Browse files
committed
Compare usernames case-insensitively
1 parent 965fa0b commit 488642c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/github.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,17 @@ impl User {
267267
}
268268

269269
// Returns the ID of the given user, if the user is in the `all` team.
270-
pub async fn get_id_for_username<'a>(
271-
client: &'a GithubClient,
270+
pub async fn get_id_for_username(
271+
client: &GithubClient,
272272
login: &str,
273273
) -> anyhow::Result<Option<u64>> {
274274
let permission = crate::team_data::teams(client).await?;
275275
let map = permission.teams;
276+
let login = login.to_lowercase();
276277
Ok(map["all"]
277278
.members
278279
.iter()
279-
.find(|g| g.github == login)
280+
.find(|g| g.github.to_lowercase() == login)
280281
.map(|u| u.github_id))
281282
}
282283

0 commit comments

Comments
 (0)