summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2018-04-20 16:46:07 -0700
committerGitHub <noreply@github.com>2018-04-20 16:46:07 -0700
commit9cfe33f97e83f060cb4394f0089c2998994af7f4 (patch)
tree9244942b18f30ac7dc125010eb4acefe0e440b85 /src
parenta73deb79cdeab9430972e6185b178aaa82ef00d4 (diff)
parentf74b69b2f4129b4857eddb0c066808b4b835cf19 (diff)
Merge pull request #1757 from ferd/fix-dialyzer-warnings
Fix various Dialyzer warnings
Diffstat (limited to 'src')
-rw-r--r--src/rebar_app_info.erl2
-rw-r--r--src/rebar_hg_resource.erl2
-rw-r--r--src/rebar_prv_escriptize.erl4
-rw-r--r--src/rebar_prv_unlock.erl8
4 files changed, 5 insertions, 11 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index de497d5..88d6335 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -301,7 +301,7 @@ app_file(#app_info_t{app_file=AppFile}) ->
AppFile.
%% @doc sets the .app file for an app.
--spec app_file(t(), file:filename_all()) -> t().
+-spec app_file(t(), file:filename_all() | undefined) -> t().
app_file(AppInfo=#app_info_t{}, AppFile) ->
AppInfo#app_info_t{app_file=AppFile}.
diff --git a/src/rebar_hg_resource.erl b/src/rebar_hg_resource.erl
index 6d25783..abcca88 100644
--- a/src/rebar_hg_resource.erl
+++ b/src/rebar_hg_resource.erl
@@ -137,7 +137,7 @@ get_branch_ref(Dir, Branch) ->
rebar_utils:sh("hg -R \"" ++ rebar_utils:escape_double_quotes(Dir) ++
"\" log --template \"{node}\n\" --rev " ++ rebar_utils:escape_chars(Branch),
[{use_stdout, false}, {debug_abort_on_error, AbortMsg}]),
- rebar_string:strip(BranchRefString, both, "\n").
+ rebar_string:trim(BranchRefString, both, "\n").
maybe_warn_local_url(Url) ->
diff --git a/src/rebar_prv_escriptize.erl b/src/rebar_prv_escriptize.erl
index 3d6e708..4d767fd 100644
--- a/src/rebar_prv_escriptize.erl
+++ b/src/rebar_prv_escriptize.erl
@@ -267,9 +267,7 @@ rm_newline(String) ->
[C || C <- String, C =/= $\n].
write_windows_script(Target) ->
- CmdPath = if is_binary(Target) -> <<Target/binary, ".cmd">>;
- is_list(Target) -> Target ++ ".cmd"
- end,
+ CmdPath = Target ++ ".cmd",
CmdScript=
"@echo off\r\n"
"setlocal\r\n"
diff --git a/src/rebar_prv_unlock.erl b/src/rebar_prv_unlock.erl
index 8480991..6fe8bd8 100644
--- a/src/rebar_prv_unlock.erl
+++ b/src/rebar_prv_unlock.erl
@@ -48,12 +48,8 @@ do(State) ->
?PRV_ERROR({file,Reason});
{ok, _} ->
Locks = rebar_config:consult_lock_file(LockFile),
- case handle_unlocks(State, Locks, LockFile) of
- {ok, NewLocks} ->
- {ok, rebar_state:set(State, {locks, default}, NewLocks)};
- {error, Reason} ->
- ?PRV_ERROR({file,Reason})
- end
+ {ok, NewLocks} = handle_unlocks(State, Locks, LockFile),
+ {ok, rebar_state:set(State, {locks, default}, NewLocks)}
end.
-spec format_error(any()) -> iolist().