Skip to content

Commit 7501996

Browse files
committed
remove redundant return value
Signed-off-by: Aminu 'Seun Joshua <[email protected]>
1 parent 9285763 commit 7501996

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

crates/runtime-config/src/variables.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,17 @@ impl VariableProviderConfiguration {
9797
}
9898

9999
pub trait VariableSourcer {
100-
fn variable_env_checker(
101-
&self,
102-
key: String,
103-
val: Variable,
104-
) -> anyhow::Result<(String, Variable)>;
100+
fn variable_env_checker(&self, key: String, val: Variable) -> anyhow::Result<()>;
105101

106102
fn check(
107103
&self,
108104
key: String,
109105
mut val: Variable,
110106
dotenv_path: Option<PathBuf>,
111107
prefix: Option<String>,
112-
) -> anyhow::Result<(String, Variable)> {
108+
) -> anyhow::Result<()> {
113109
if val.default.is_some() {
114-
return Ok((key, val));
110+
return Ok(());
115111
}
116112

117113
if let Some(path) = dotenv_path {
@@ -121,7 +117,7 @@ pub trait VariableSourcer {
121117
match std::env::var(env_key(prefix, &key)) {
122118
Ok(v) => {
123119
val.default = Some(v);
124-
Ok((key, val))
120+
Ok(())
125121
}
126122
Err(_) => Err(anyhow::anyhow!(
127123
"Variable data not provided for {}",

crates/trigger/src/cli/variables.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ impl<F: RuntimeFactors, U> ExecutorHooks<F, U> for VariableSorterExecutorHooks {
2828
}
2929

3030
impl VariableSourcer for VariableSorterExecutorHooks {
31-
fn variable_env_checker(
32-
&self,
33-
key: String,
34-
val: spin_app::Variable,
35-
) -> anyhow::Result<(String, spin_app::Variable)> {
31+
fn variable_env_checker(&self, key: String, val: spin_app::Variable) -> anyhow::Result<()> {
3632
let configs = spin_variables::variable_provider_config_from_toml(&self.table)?;
3733

3834
if let Some(config) = configs.into_iter().next() {

0 commit comments

Comments
 (0)