Skip to content

Commit

Permalink
Use unwrap_or_default instead of or_insert_with
Browse files Browse the repository at this point in the history
  • Loading branch information
aisrael committed Mar 17, 2024
1 parent 9de2e9e commit 86f2e10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ghctl/repo/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ impl RepoConfig {
if let Some(teams) = self.teams.as_ref() {
let org = orgs_teams
.entry(owner.to_string())
.or_insert_with(HashMap::new);
.unwrap_or_default(HashMap::new);

for (team_slug, permission) in teams {
debug!("Validating permission {permission}");
Expand Down Expand Up @@ -663,7 +663,7 @@ impl RepoConfig {
} else {
let teams = orgs_teams
.entry(org.to_string())
.or_insert_with(HashMap::new);
.unwrap_or_default(HashMap::new);
if !teams.contains_key(team_slug) {
debug!("Validating team {team_slug}");
let team = octocrab.teams(org).get(team_slug).await?;
Expand Down

0 comments on commit 86f2e10

Please sign in to comment.