Skip to content

Commit

Permalink
Merge pull request #18 from filipecabaco/change-defp-name-to-avoid-di…
Browse files Browse the repository at this point in the history
…alyzer-match

fix: Changes function name to avoid dialyzer issues
  • Loading branch information
filipecabaco authored Nov 16, 2023
2 parents 2f5f718 + 89e3056 commit 05d45f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions lib/francis.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule Francis do

defoverridable(start: 2)

defp handle_resp(handler, conn, status \\ 200) do
defp handle_response(handler, conn, status \\ 200) do
case handler.(conn) do
res when is_struct(res, Plug.Conn) ->
res
Expand Down Expand Up @@ -77,7 +77,7 @@ defmodule Francis do
"""
defmacro get(path, handler) do
quote location: :keep do
Plug.Router.get(unquote(path), do: handle_resp(unquote(handler), var!(conn)))
Plug.Router.get(unquote(path), do: handle_response(unquote(handler), var!(conn)))
end
end

Expand All @@ -99,7 +99,7 @@ defmodule Francis do

defmacro post(path, handler) do
quote location: :keep do
Plug.Router.post(unquote(path), do: handle_resp(unquote(handler), var!(conn)))
Plug.Router.post(unquote(path), do: handle_response(unquote(handler), var!(conn)))
end
end

Expand All @@ -121,7 +121,7 @@ defmodule Francis do

defmacro put(path, handler) do
quote location: :keep do
Plug.Router.put(unquote(path), do: handle_resp(unquote(handler), var!(conn)))
Plug.Router.put(unquote(path), do: handle_response(unquote(handler), var!(conn)))
end
end

Expand All @@ -143,7 +143,7 @@ defmodule Francis do

defmacro delete(path, handler) do
quote location: :keep do
Plug.Router.delete(unquote(path), do: handle_resp(unquote(handler), var!(conn)))
Plug.Router.delete(unquote(path), do: handle_response(unquote(handler), var!(conn)))
end
end

Expand All @@ -165,7 +165,7 @@ defmodule Francis do

defmacro patch(path, handler) do
quote location: :keep do
Plug.Router.patch(unquote(path), do: handle_resp(unquote(handler), var!(conn)))
Plug.Router.patch(unquote(path), do: handle_response(unquote(handler), var!(conn)))
end
end

Expand Down Expand Up @@ -241,7 +241,7 @@ defmodule Francis do
defmacro unmatched(handler) do
quote location: :keep do
match _ do
handle_resp(unquote(handler), var!(conn), 404)
handle_response(unquote(handler), var!(conn), 404)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Francis.MixProject do
use Mix.Project

@version "0.1.3"
@version "0.1.4"

def project do
[
Expand Down

0 comments on commit 05d45f7

Please sign in to comment.