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

Swap download/2 argument order #34

Merged
merged 2 commits into from
Jan 28, 2022
Merged

Swap download/2 argument order #34

merged 2 commits into from
Jan 28, 2022

Conversation

Glutexo
Copy link
Owner

@Glutexo Glutexo commented Jan 21, 2022

The http_client argument is a configuration, url is an input. Keep
input values first to make it easier to use with |> piping.

get_url() |> download(http_client)

The `http_client` argument is a configuration, `url` is an input. Keep
input values first to make it easier to use with |> piping.

```elixir
get_url() |> download(http_client)
```
@Glutexo Glutexo requested a review from nappex January 21, 2022 23:55
@Glutexo Glutexo self-assigned this Jan 21, 2022
@Glutexo Glutexo mentioned this pull request Jan 22, 2022
6 tasks
@@ -10,10 +10,10 @@ defmodule Onigumo do
http = http_client()

load_urls(@input_filename)
|> Enum.map(&download(http, &1))
|> Enum.map(&download(&1, http))
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
|> Enum.map(&download(&1, http))
|> Enum.map(fn url -> download(url, http) end)

@Glutexo Glutexo merged commit b160bb1 into elixir Jan 28, 2022
@Glutexo Glutexo deleted the arg-order branch January 28, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants