Skip to content

Commit

Permalink
Merge pull request #3 from jbovet/fix-fmt
Browse files Browse the repository at this point in the history
fix: format provider linter error
  • Loading branch information
jbovet authored May 30, 2024
2 parents 676e986 + d351f66 commit ede0acf
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions crates/env-var/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,15 @@ fn evaluate_environment_variable<T: std::str::FromStr>(
) -> EvaluationResult<ResolutionDetails<T>> {
match std::env::var(flag_key) {
Ok(value) => match value.parse::<T>() {
Ok(parsed_value) => {
EvaluationResult::Ok(
ResolutionDetails::builder()
.value(parsed_value)
.reason(EvaluationReason::Static)
.build(),
)
}
Err(_) => {
error(EvaluationErrorCode::TypeMismatch)
}
Ok(parsed_value) => EvaluationResult::Ok(
ResolutionDetails::builder()
.value(parsed_value)
.reason(EvaluationReason::Static)
.build(),
),
Err(_) => error(EvaluationErrorCode::TypeMismatch),
},
Err(_) => {
error(EvaluationErrorCode::FlagNotFound)
}
Err(_) => error(EvaluationErrorCode::FlagNotFound),
}
}
/// Error helper function to return an [`EvaluationResult`] with an [`EvaluationError`]
Expand Down

0 comments on commit ede0acf

Please sign in to comment.