Skip to content

Commit

Permalink
Fix dialyzer warnings for webmachine_request:port_string()
Browse files Browse the repository at this point in the history
Fixes two bugs:

    % git branch | egrep '\*'
    * master

    % git log | head -1
    commit 656aa69

    % dialyzer -Wno_return ebin/*beam deps/*/ebin/*beam
      Checking whether the PLT /Users/fritchie/.dialyzer_plt is up-to-date... yes
      Compiling some key modules to native code... done in 0m21.94s
      Proceeding with analysis...
    webmachine_request.erl:815: The pattern 'http' can never match the type string()
    webmachine_request.erl:820: The pattern 'https' can never match the type string()
    Unknown functions:
      compile:forms/2
      fdsrv:bind_socket/2
      fdsrv:start/0
      fdsrv:stop/0
     done in 0m15.44s
    done (warnings were emitted)
  • Loading branch information
slfritchie committed Apr 5, 2012
1 parent 656aa69 commit 01f866d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webmachine_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,12 @@ log_data() -> call(log_data).

port_string(Scheme, Port) ->
case Scheme of
http ->
"http" ->
case Port of
80 -> "";
_ -> ":" ++ erlang:integer_to_list(Port)
end;
https ->
"https" ->
case Port of
443 -> "";
_ -> ":" ++ erlang:integer_to_list(Port)
Expand Down

0 comments on commit 01f866d

Please sign in to comment.