When trying to stringify a struct an error is raised because structs
don't implement enumerable by default. This happens because using
Kernel.is_map/1 matches both structs and maps.
The fix is to pattern match against %{__struct__: _struct} before
using a guard with is_map.
Let me know if this solution works out or if there's a better alternative, thanks!
When trying to stringify a struct an error is raised because structs don't implement enumerable by default. This happens because using
Kernel.is_map/1
matches both structs and maps.The fix is to pattern match against
%{__struct__: _struct}
before using a guard withis_map
.Let me know if this solution works out or if there's a better alternative, thanks!