From f4c6b685cc09d6db4d004a71a473e04d4b0ebd66 Mon Sep 17 00:00:00 2001 From: Alex Koutmos Date: Sun, 9 Oct 2022 00:47:53 -0400 Subject: [PATCH] Minor tweak to a function implementation --- lib/prom_ex/utils.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/prom_ex/utils.ex b/lib/prom_ex/utils.ex index bc0714e..6dfd062 100644 --- a/lib/prom_ex/utils.ex +++ b/lib/prom_ex/utils.ex @@ -61,7 +61,8 @@ defmodule PromEx.Utils do Converts a `time_unit` to its plural form. """ @spec make_plural_atom(System.time_unit()) :: atom() - def make_plural_atom(word) do - String.to_existing_atom("#{Atom.to_string(word)}s") - end + def make_plural_atom(:second), do: :seconds + def make_plural_atom(:millisecond), do: :milliseconds + def make_plural_atom(:microsecond), do: :microseconds + def make_plural_atom(:nanosecond), do: :nanoseconds end