fix warning about unsafe variable #1

Merged
bobjflong merged 1 commit from BL/warn into master 2016-09-05 19:30:27 +12:00
bobjflong commented 2016-09-04 07:03:35 +12:00 (Migrated from github.com)

Thank you for lex_luthor! This fixes a warning I receive when compiling.

> elixir --version
Erlang/OTP 19 [erts-8.0.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.3.2
warning: the variable "state" 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/lex_luthor.ex:159
Thank you for `lex_luthor`! This fixes a warning I receive when compiling. ``` > elixir --version Erlang/OTP 19 [erts-8.0.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Elixir 1.3.2 ``` ``` warning: the variable "state" 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/lex_luthor.ex:159 ```
jimsynz commented 2016-09-05 19:30:24 +12:00 (Migrated from github.com)

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: james/lex_luthor#1
No description provided.