maps.ex (342B)
- # NewsParseEx: RSS/Atom parser
- # Copyright © 2023 Haelwenn (lanodan) Monnier <contact+news_parse_ex@hacktivis.me>
- # SPDX-License-Identifier: AGPL-3.0-only
- defmodule NewsParseEx.Maps do
- def put_if_ok(map, key, {:ok, value}) when is_map(map) and key != nil do
- Map.put(map, key, value)
- end
- def put_if_ok(map, _key, _n), do: map
- end