79756622

Date: 2025-09-05 09:48:43
Score: 0.5
Natty:
Report link

Not much common to do so, but you can write it like this:

defguard has_cards(player)
  when is_map_key(:cards, player) and :erlang.map_get(player, :cards) not in [[], nil]
defguard has_cards(player)
  when is_struct(player, Player) and :erlang.map_get(player, :cards) not in [[], nil]
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: canelle