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

Fix spec on register_options/2 #376

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions lib/req/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ defmodule Req.Request do
iex> Req.Request.get_option_lazy(req, :b, fun)
42
"""
@spec get_option_lazy(t(), atom(), (-> term())) :: term()
@spec get_option_lazy(t(), atom(), (() -> term())) :: term()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

got this from running mix format

Copy link
Owner

Choose a reason for hiding this comment

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

this is because you're probably using older Elixir version. We always use the latest for formatting!

wojtekmach marked this conversation as resolved.
Show resolved Hide resolved
def get_option_lazy(request, key, fun) when is_function(fun, 0) do
Map.get_lazy(request.options, key, fun)
end
Expand Down Expand Up @@ -1035,7 +1035,7 @@ defmodule Req.Request do
Req.get!(req, url: "/status/201", foo: :bar).status
#=> 201
"""
@spec register_options(t(), keyword()) :: t()
@spec register_options(t(), [atom()]) :: t()
def register_options(%Req.Request{} = request, options) when is_list(options) do
update_in(request.registered_options, &MapSet.union(&1, MapSet.new(options)))
end
Expand Down