title: Elixir convert struct to map
body: <p>I'm trying to convert a struct to a map to be able to clean all the nil values</p>
  
  <p>I'm currently using this code </p>
  
  <pre><code>  case Nadia.get_updates  do
      {:ok, results} -&gt;
        Map.from_struct(results)
        |&gt; Enum.filter(fn {_, v} -&gt; v != nil end)
        |&gt; Enum.into(%{})
  </code></pre>
  
  <p>Note: Nadia.get_updates returns the following structure:
  <a href="https://hexdocs.pm/nadia/Nadia.Model.Update.html#t:t/0" rel="noreferrer">https://hexdocs.pm/nadia/Nadia.Model.Update.html#t:t/0</a></p>
  
  <p>Yet I'm always receiving the following error: no function clause matching in Map.from_struct/1</p>