Skip to content

Commit

Permalink
Minor tweak to a function implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
akoutmos committed Oct 9, 2022
1 parent da83cca commit f4c6b68
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/prom_ex/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f4c6b68

Please sign in to comment.