From 3e55cb62c9053895412b1cf2a65d54ef90eda34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 25 May 2011 23:02:40 +0200 Subject: Refresh the type specifications. Following discussions on #erlounge. Also fixes compilation in R14B03 and fixes a few underspecs dialyzer warnings. --- src/cowboy_clock.erl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/cowboy_clock.erl') diff --git a/src/cowboy_clock.erl b/src/cowboy_clock.erl index 6d8d8f9..f53c81a 100644 --- a/src/cowboy_clock.erl +++ b/src/cowboy_clock.erl @@ -46,7 +46,7 @@ %% API. --spec start_link() -> {ok, Pid::pid()}. +-spec start_link() -> {ok, pid()}. start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []). @@ -96,8 +96,7 @@ code_change(_OldVsn, State, _Extra) -> %% Internal. --spec update_rfc1123(Prev::undefined | datetime(), Now::datetime(), - Bin::binary()) -> binary(). +-spec update_rfc1123(undefined | datetime(), datetime(), binary()) -> binary(). update_rfc1123(Now, Now, Bin) -> Bin; update_rfc1123({Date, {H, M, _}}, {Date, {H, M, S}}, @@ -136,7 +135,7 @@ pad_int(X) when X < 10 -> pad_int(X) -> list_to_binary(integer_to_list(X)). --spec weekday(daynum()) -> binary(). +-spec weekday(daynum()) -> <<_:24>>. weekday(1) -> <<"Mon">>; weekday(2) -> <<"Tue">>; weekday(3) -> <<"Wed">>; @@ -145,7 +144,7 @@ weekday(5) -> <<"Fri">>; weekday(6) -> <<"Sat">>; weekday(7) -> <<"Sun">>. --spec month(month()) -> binary(). +-spec month(month()) -> <<_:24>>. month( 1) -> <<"Jan">>; month( 2) -> <<"Feb">>; month( 3) -> <<"Mar">>; -- cgit v1.2.3