Skip to content

Commit fed8aaa

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

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

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() {

crates/variables/src/lib.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,17 @@ impl VariableProviderConfiguration {
9494
}
9595

9696
pub trait VariableSourcer {
97-
fn variable_env_checker(
98-
&self,
99-
key: String,
100-
val: Variable,
101-
) -> anyhow::Result<(String, Variable)>;
97+
fn variable_env_checker(&self, key: String, val: Variable) -> anyhow::Result<()>;
10298

10399
fn check(
104100
&self,
105101
key: String,
106102
mut val: Variable,
107103
dotenv_path: Option<PathBuf>,
108104
prefix: Option<String>,
109-
) -> anyhow::Result<(String, Variable)> {
105+
) -> anyhow::Result<()> {
110106
if val.default.is_some() {
111-
return Ok((key, val));
107+
return Ok(());
112108
}
113109

114110
if let Some(path) = dotenv_path {
@@ -118,7 +114,7 @@ pub trait VariableSourcer {
118114
match std::env::var(env_key(prefix, &key)) {
119115
Ok(v) => {
120116
val.default = Some(v);
121-
Ok((key, val))
117+
Ok(())
122118
}
123119
Err(_) => Err(anyhow::anyhow!(
124120
"Variable data not provided for {}",

0 commit comments

Comments
 (0)