billc
11/30/2017 - 5:56 PM

Drop Nil Valued Keys in a Struct

my_map =
  for {k, v} <- Map.from_struct(my_struct), v != nil, into: %{}, do: {Atom.to_string(k), v}