Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethereum: fix GETH_ETH_CALL_ERRORS_ENV #2784

Merged
merged 1 commit into from
Sep 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ lazy_static! {
/// Additional deterministic errors that have not yet been hardcoded. Separated by `;`.
static ref GETH_ETH_CALL_ERRORS_ENV: Vec<String> = {
std::env::var("GRAPH_GETH_ETH_CALL_ERRORS")
.unwrap_or_default()
.split(';')
.map(ToOwned::to_owned)
.collect()
.map(|s| s.split(';').filter(|s| s.len() > 0).map(ToOwned::to_owned).collect())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually s.is_empty() is a better and clearer option then s.len() > 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always have a hard time reasoning over negated conditionals, so I prefer s.len() > 0 over !s.is_empty().

.unwrap_or(Vec::new())
};
}

Expand Down