I'd define the following function:
def rename(map, old_key, new_key) do
case Map.pop(map, old_key) do
{nil, _} -> map
{value, map2} -> Map.put(map2, new_key, value)
end
end
and then it's simply a matter of:
Enum.map(maps, &rename(&1, :code, :product_code))