diff --git a/lib/ex_doc/language/elixir.ex b/lib/ex_doc/language/elixir.ex index 67459a732..e64ac42ad 100644 --- a/lib/ex_doc/language/elixir.ex +++ b/lib/ex_doc/language/elixir.ex @@ -96,7 +96,7 @@ defmodule ExDoc.Language.Elixir do # If it is none, then we need to look at underscore. # TODO: We can remove this on Elixir v1.13 as all underscored are hidden. defp doc?({{_, name, _}, _, _, :none, _}, _type) do - hd(Atom.to_charlist(name)) != ?_ + not match?([?_ | _], Atom.to_charlist(name)) end # Everything else is hidden. diff --git a/lib/ex_doc/refs.ex b/lib/ex_doc/refs.ex index 4a7dac33f..b09b3b391 100644 --- a/lib/ex_doc/refs.ex +++ b/lib/ex_doc/refs.ex @@ -116,7 +116,7 @@ defmodule ExDoc.Refs do defguardp has_no_docs(doc) when doc == :none or doc == %{} - defp starts_with_underscore?(name), do: hd(Atom.to_charlist(name)) == ?_ + defp starts_with_underscore?(name), do: match?([?_ | _], Atom.to_charlist(name)) defp visibility(:hidden), do: :hidden