Skip to content

Commit

Permalink
Avoid warning with Elixir 1.3.1
Browse files Browse the repository at this point in the history
Compiling 2 files (.ex)
warning: the variable "log" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/ex_syslog.ex:35
  • Loading branch information
ahamez committed Jun 29, 2016
1 parent 78890dd commit af11ff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ex_syslog.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ defmodule ExSyslog do
%{name: name, log: log, config: config} = state) do
new_config = get_config(name, options)

if config.facility !== new_config.facility or
{:ok, log} = if config.facility !== new_config.facility or
config.ident !== new_config.ident or
config.option !== new_config.option do

close_log(log)
{:ok, log} = open_log(new_config)
open_log(new_config)
end

new_state = %{state | log: log, config: new_config}
Expand Down

0 comments on commit af11ff9

Please sign in to comment.