Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

Commit

Permalink
Problem: Upcoming Elixir 1.2 adds additional warnings regarding code …
Browse files Browse the repository at this point in the history
…style

Solution: Fix all Elixir 1.2 warnings
  • Loading branch information
c-rack committed Nov 26, 2015
1 parent 5af5ff8 commit 8013618
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/quantum/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ defmodule Quantum.Parser do
@moduledoc false

def parse("*/" <> i, min, max) do
min..max |> only_multiplier_of i
min..max |> only_multiplier_of(i)
end

def parse(e, min, max) do
[r|i] = e |> String.split("/")
[x|y] = r |> String.split("-")
v = x |> String.to_integer
do_parse(v, y, i, min, max) |> Enum.filter &(&1 in min..max)
do_parse(v, y, i, min, max) |> Enum.filter(&(&1 in min..max))
end

defp do_parse(v, [], [], _, _), do: [v]
Expand All @@ -29,12 +29,12 @@ defmodule Quantum.Parser do
end

defp do_parse(v, y, [i], min, max) do
do_parse(v, y, [], min, max) |> only_multiplier_of i
do_parse(v, y, [], min, max) |> only_multiplier_of(i)
end

defp only_multiplier_of(coll, i) do
x = i |> String.to_integer
coll |> Enum.filter &(rem(&1, x) == 0)
coll |> Enum.filter(&(rem(&1, x) == 0))
end

end
6 changes: 3 additions & 3 deletions lib/quantum/timer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ defmodule Quantum.Timer do

@moduledoc false

case Application.get_env(:quantum, :timezone, :utc) do
now = case Application.get_env(:quantum, :timezone, :utc) do
:utc ->
now = &:calendar.now_to_universal_time/1
&:calendar.now_to_universal_time/1
:local ->
now = &:calendar.now_to_local_time/1
&:calendar.now_to_local_time/1
timezone ->
raise "Unsupported timezone: #{timezone}"
end
Expand Down

0 comments on commit 8013618

Please sign in to comment.