Skip to content

Commit

Permalink
Fix compiler warnings in 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Aug 8, 2018
1 parent 885be0b commit 84067f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
6 changes: 2 additions & 4 deletions lib/calendar/julian.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ defmodule Timex.Calendar.Julian do
def julian_date({year, month, day}),
do: julian_date(year, month, day)

@doc """
Same as julian_date/1, except takes an Erlang datetime, and returns a more precise Julian date number
"""
# Same as julian_date/1, except takes an Erlang datetime, and returns a more precise Julian date number
@spec julian_date(Types.datetime) :: float
def julian_date({{year, month, day}, {hour, minute, second}}) do
julian_date(year, month, day, hour, minute, second)
Expand Down Expand Up @@ -78,7 +76,7 @@ defmodule Timex.Calendar.Julian do
:mon -> mod(cardinal + 6, 7) + 1
end
end
def day_of_week(_, _, _, weekstart) when not weekstart in [:sun, :mon] do
def day_of_week(_, _, _, weekstart) when weekstart not in [:sun, :mon] do
{:error, {:bad_weekstart_value, expected: [:sun, :mon], got: weekstart}}
end
def day_of_week(_,_,_, _) do
Expand Down
2 changes: 1 addition & 1 deletion lib/comparable/diff.ex
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ defmodule Timex.Comparable.Diff do
defp do_diff(a, b, :years) do
diff_years(a, b)
end
defp do_diff(_, _, granularity) when not granularity in @units,
defp do_diff(_, _, granularity) when granularity not in @units,
do: {:error, {:invalid_granularity, granularity}}

defp diff_years(a, b) do
Expand Down
6 changes: 2 additions & 4 deletions lib/timex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ defmodule Timex do
iex> use Timex
...> Timex.from_now(Timex.shift(DateTime.utc_now(), days: 2, hours: 1), "ru")
"через 2 дней"
"через 2 дня"
iex> use Timex
...> Timex.from_now(Timex.shift(DateTime.utc_now(), days: -2), "ru")
Expand All @@ -306,9 +306,7 @@ defmodule Timex do
end
end

@doc """
Formats a DateTime using a fuzzy relative duration, with a reference datetime other than now
"""
# Formats a DateTime using a fuzzy relative duration, with a reference datetime other than now
@spec from_now(Types.valid_datetime, Types.valid_datetime) :: String.t | {:error, term}
def from_now(datetime, reference_date),
do: from_now(datetime, reference_date, Timex.Translator.default_locale)
Expand Down
8 changes: 3 additions & 5 deletions lib/timezone/timezone.ex
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,9 @@ defmodule Timex.Timezone do
end
end

@doc """
This version of resolve/3 takes a timezone name as a string, and an Erlang datetime tuple,
and attempts to resolve the date and time in that timezone. Unlike the previous clause of resolve/2,
this one will return either an error, a DateTime struct, or an AmbiguousDateTime struct.
"""
# This version of resolve/3 takes a timezone name as a string, and an Erlang datetime tuple,
# and attempts to resolve the date and time in that timezone. Unlike the previous clause of resolve/2,
# this one will return either an error, a DateTime struct, or an AmbiguousDateTime struct.
@spec resolve(Types.valid_timezone, Types.datetime, :utc | :wall) :: DateTime.t |
AmbiguousDateTime.t | {:error, term}
# These are shorthand for specific time zones
Expand Down

0 comments on commit 84067f8

Please sign in to comment.