From c55cf6ea2af2dcfb303b51168727ac956cc6f8da Mon Sep 17 00:00:00 2001 From: Bob Long Date: Sat, 3 Sep 2016 19:59:16 +0100 Subject: [PATCH] fix warning about unsafe variable --- lib/lex_luthor.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/lex_luthor.ex b/lib/lex_luthor.ex index 36bc210..bae081b 100644 --- a/lib/lex_luthor.ex +++ b/lib/lex_luthor.ex @@ -153,8 +153,10 @@ defmodule LexLuthor do defp rules_for_state rules, state do Enum.filter rules, fn({rule_state,_,_})-> - if is_nil(state) do - state = :default + state = if is_nil(state) do + :default + else + state end state == rule_state end