From ad32cefc6f441c9b609e05b8e8592f1f5f1beddd Mon Sep 17 00:00:00 2001 From: Andrew Kenworthy Date: Fri, 16 Aug 2024 11:20:16 +0200 Subject: [PATCH] used named tuple for readability --- rust/crd/src/history.rs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/rust/crd/src/history.rs b/rust/crd/src/history.rs index 4f4e5fb9..882dec2c 100644 --- a/rust/crd/src/history.rs +++ b/rust/crd/src/history.rs @@ -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, }, ) @@ -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);