Skip to content

Commit

Permalink
chore(jans-cedarling): replace unwrap_or with unwrap_or_else
Browse files Browse the repository at this point in the history
- replace unwrap_or with unwrap_or_else for laziness

Signed-off-by: rmarinn <[email protected]>
  • Loading branch information
rmarinn committed Jan 8, 2025
1 parent b0d43d9 commit 1cd49b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jans-cedarling/cedarling/src/authz/entity_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ impl From<&AuthorizationConfig> for EntityNames {
user: config
.mapping_user
.clone()
.unwrap_or(DEFAULT_USER_ENTITY_NAME.to_string()),
.unwrap_or_else(|| DEFAULT_USER_ENTITY_NAME.to_string()),
workload: config
.mapping_workload
.clone()
.unwrap_or(DEFAULT_WORKLOAD_ENTITY_NAME.to_string()),
.unwrap_or_else(|| DEFAULT_WORKLOAD_ENTITY_NAME.to_string()),
id_token: config
.mapping_id_token
.clone()
.unwrap_or(DEFAULT_ID_TKN_ENTITY_NAME.to_string()),
.unwrap_or_else(|| DEFAULT_ID_TKN_ENTITY_NAME.to_string()),
access_token: config
.mapping_access_token
.clone()
.unwrap_or(DEFAULT_ACCESS_TKN_ENTITY_NAME.to_string()),
.unwrap_or_else(|| DEFAULT_ACCESS_TKN_ENTITY_NAME.to_string()),
userinfo_token: config
.mapping_userinfo_token
.clone()
.unwrap_or(DEFAULT_USERINFO_TKN_ENTITY_NAME.to_string()),
.unwrap_or_else(|| DEFAULT_USERINFO_TKN_ENTITY_NAME.to_string()),
// TODO: implement a bootstrap property to set the Role entity name
role: DEFAULT_ROLE_ENTITY_NAME.to_string(),
}
Expand Down

0 comments on commit 1cd49b9

Please sign in to comment.