title: Multiple if condition in elixir
body: <p>How can I implement multiple if conditions in my code like below</p>
  
  <pre><code>person = %Person{}
  
  if x.name == "Test" do 
    person = %{person | name: "Test"}
  end
  
  if x.age == 50 do 
   person = %{person | age: 50}
  end
  </code></pre>
  
  <p>here "x" is another object where I am trying to validate data and then updating person struct accordingly. 
  I already wrote code as above but got a below warning </p>
  
  <blockquote>
    <p>the variable "person" is unsafe as it has been set inside one of:
    case, cond, receive, if, and, or, &amp;&amp;, ||. Please explicitly return the
    variable value instead. For example:</p>
  
  <pre><code>case integer do
    1 -&gt; atom = :one
    2 -&gt; atom = :two
  end
  </code></pre>
    
    <p>should be written as</p>
  
  <pre><code>atom =
    case integer do
      1 -&gt; :one
      2 -&gt; :two
    end
  </code></pre>
  </blockquote>