Skip to content

Commit 6c6e2aa

Browse files
committed
Remove dead code found by the type system
warning: incompatible types given to String.to_atom/1: String.to_atom(template) given types: dynamic(false or {term(), binary()}) but expected one of: binary() where "template" was given the type: # type: dynamic(false or {term(), binary()}) # from: lib/phoenix_live_view/router.ex:300:18 template = Phoenix.LiveView.Utils.normalize_layout(template) typing violation found at: │ 301 │ Map.put(acc, :root_layout, {mod, String.to_atom(template)}) │ ~ │ └─ lib/phoenix_live_view/router.ex:301:49: Phoenix.LiveView.Router.validate_live_session_opts/3
1 parent 74dc68d commit 6c6e2aa

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lib/phoenix_live_view/router.ex

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ defmodule Phoenix.LiveView.Router do
296296
expected a map with string keys or an MFA tuple, got #{inspect(bad_session)}
297297
"""
298298

299-
{:root_layout, {mod, template}}, acc when is_atom(mod) and is_binary(template) ->
300-
template = Phoenix.LiveView.Utils.normalize_layout(template)
301-
Map.put(acc, :root_layout, {mod, String.to_atom(template)})
302-
303299
{:root_layout, {mod, template}}, acc when is_atom(mod) and is_atom(template) ->
304300
Map.put(acc, :root_layout, {mod, template})
305301

@@ -313,10 +309,6 @@ defmodule Phoenix.LiveView.Router do
313309
expected a tuple with the view module and template atom name, got #{inspect(bad_layout)}
314310
"""
315311

316-
{:layout, {mod, template}}, acc when is_atom(mod) and is_binary(template) ->
317-
template = Phoenix.LiveView.Utils.normalize_layout(template)
318-
Map.put(acc, :layout, {mod, template})
319-
320312
{:layout, {mod, template}}, acc when is_atom(mod) and is_atom(template) ->
321313
Map.put(acc, :layout, {mod, template})
322314

0 commit comments

Comments
 (0)