Skip to content

Add info about structs in the encode docs #19

@williamthome

Description

@williamthome

The encode documentation misses that structs are handled by the encode_map function as:

  defp encode_map(struct, state) when is_map_key(struct, :__struct__) do
    :euneus_encoder.encode_map(Map.from_struct(struct), state)
  end

  defp encode_map(map, state) do
    :euneus_encoder.encode_map(map, state)
  end

i.e., structs are encoded as Map.from_struct(struct).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions