Skip to content

Commit

Permalink
used named tuple for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
adwk67 committed Aug 16, 2024
1 parent 53f7d59 commit ad32cef
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions rust/crd/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,12 @@ impl SparkHistoryServer {
);

// apply the role overrides
let mut role_envs = role_env_overrides.iter().map(|env_var| {
let mut role_envs = role_env_overrides.iter().map(|(env_name, env_value)| {
(
env_var.0.clone(),
env_name.clone(),
EnvVar {
name: env_var.0.clone(),
value: Some(env_var.1.to_owned()),
name: env_name.clone(),
value: Some(env_value.to_owned()),
value_from: None,
},
)
Expand All @@ -306,16 +306,19 @@ impl SparkHistoryServer {
vars.extend(&mut role_envs);

// apply the role-group overrides
let mut role_group_envs = role_group_env_overrides.into_iter().map(|env_var| {
(
env_var.0.clone(),
EnvVar {
name: env_var.0.clone(),
value: Some(env_var.1),
value_from: None,
},
)
});
let mut role_group_envs =
role_group_env_overrides
.into_iter()
.map(|(env_name, env_value)| {
(
env_name.clone(),
EnvVar {
name: env_name.clone(),
value: Some(env_value),
value_from: None,
},
)
});

vars.extend(&mut role_group_envs);

Expand Down

0 comments on commit ad32cef

Please sign in to comment.