Skip to content

Commit b389d17

Browse files
committed
Fix dead code and overriden clauses found by the type system
1 parent 25523c9 commit b389d17

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/ex_doc/formatter/html/templates.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,8 @@ defmodule ExDoc.Formatter.HTML.Templates do
152152
end)
153153
end
154154

155-
defp favicon_path(%{favicon: nil}), do: nil
156155
defp favicon_path(%{favicon: favicon}), do: "assets/favicon#{Path.extname(favicon)}"
157156

158-
defp logo_path(%{logo: nil}), do: nil
159157
defp logo_path(%{logo: logo}), do: "assets/logo#{Path.extname(logo)}"
160158

161159
defp sidebar_type(:exception), do: "modules"

lib/ex_doc/language/elixir.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,17 +559,17 @@ defmodule ExDoc.Language.Elixir do
559559

560560
defp to_var({:%, meta, [name, _]}, _), do: {:%, meta, [name, {:%{}, meta, []}]}
561561
defp to_var({:%{}, _, _}, _), do: {:map, [], nil}
562+
defp to_var({:<<>>, _, _}, _), do: {:binary, [], nil}
563+
defp to_var({:{}, _, _}, _), do: {:tuple, [], nil}
562564
defp to_var({name, meta, _}, _) when is_atom(name), do: {name, meta, nil}
563565

564566
defp to_var({{:., meta, [_module, name]}, _, _args}, _) when is_atom(name),
565567
do: {name, meta, nil}
566568

567569
defp to_var([{:->, _, _} | _], _), do: {:function, [], nil}
568-
defp to_var({:<<>>, _, _}, _), do: {:binary, [], nil}
569-
defp to_var({:{}, _, _}, _), do: {:tuple, [], nil}
570570
defp to_var({_, _}, _), do: {:tuple, [], nil}
571571
defp to_var(integer, _) when is_integer(integer), do: {:integer, [], nil}
572-
defp to_var(float, _) when is_integer(float), do: {:float, [], nil}
572+
defp to_var(float, _) when is_float(float), do: {:float, [], nil}
573573
defp to_var(list, _) when is_list(list), do: {:list, [], nil}
574574
defp to_var(atom, _) when is_atom(atom), do: {:atom, [], nil}
575575
defp to_var(_, position), do: {:"arg#{position}", [], nil}

0 commit comments

Comments
 (0)