Writing idiomatic Elixir code

It will, there are re-assignment for out:

out = if ...
  out ++ ...
else
  out
end

so every consequent out is different variable