Fix dialyzer errors

This commit is contained in:
Mikko Ahlroth 2018-03-12 21:41:28 +02:00
parent fb43cadda7
commit d1e341e37c
2 changed files with 10 additions and 4 deletions

6
.gitignore vendored
View file

@ -18,3 +18,9 @@ erl_crash.dump
# Also ignore archive artifacts (built via "mix archive.build"). # Also ignore archive artifacts (built via "mix archive.build").
*.ez *.ez
# ElixirLS stuffz
.elixir_ls
# VSCode stuffz
.vscode

View file

@ -11,7 +11,7 @@ defmodule MBU.TaskUtils do
@watch_combine_time 200 @watch_combine_time 200
@typep task_name :: String.t | module @typep task_name :: String.t | module
@typep task_list :: [task_name | fun | {task_name, [...]}] @typep task_list :: [task_name | fun | {task_name, list}]
defmodule ProgramSpec do defmodule ProgramSpec do
@moduledoc """ @moduledoc """
@ -54,7 +54,7 @@ defmodule MBU.TaskUtils do
See run_tasks/2 for the argument description. See run_tasks/2 for the argument description.
""" """
@spec run_task(task_name, [...]) :: any @spec run_task(task_name, list) :: any
def run_task(task, args \\ []) do def run_task(task, args \\ []) do
run_tasks([{task, args}]) run_tasks([{task, args}])
end end
@ -341,10 +341,10 @@ defmodule MBU.TaskUtils do
and the diff also. and the diff also.
""" """
@spec print_size(String.t, String.t) :: any @spec print_size(String.t, String.t) :: any
def print_size(new_file, old_file \\ nil) do def print_size(new_file, old_file \\ "") do
new_size = get_size(new_file) new_size = get_size(new_file)
{prefix, postfix} = if old_file != nil do {prefix, postfix} = if old_file != "" do
old_size = get_size(old_file) old_size = get_size(old_file)
{ {