DR
Size: a a a
DR
ŹR
ŹR
ŹR
ŹR
def seconds_to_string(0), do: “00”
…
def seconds_to_string(59), do: “59”
AB
NM
ŹR
NM
ŹR
iex(1)> inspect 45
"45"
iex(2)> to_string 45
"45"
NM
ŹR
iex(3)> a = inspect(45)
"45"
iex(4)> a
"45"
iex(5)> is_binary a
true
NM
NM
МБ
@spec chek_path!(nil | Path.t()) :: boolean | no_return()
def chek_path!(nil), do: raise("Не указан путь")
def chek_path!(path) do
if File.exists?(path) do
path
else
raise("Файл #{path} не существует")
end
end
File.exists? сделал Path.t(), а диалайзер меня посылаетŹR
ŹR
МБ
Invalid type specification for function 'Elixir.Helpers.Tools':'chek_path!'/1. The success typing is (binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | char(),binary() | [])) -> binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | char(),binary() | [])ElixirLS Dialyzer
ŹR
ŹR
@spec chek_path!(nil | Path.t()) :: Path.t() | no_return()