Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Fix typespec on add_context since keyword is a valid type #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/timber.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule Timber do

See `add_context/2`
"""
@spec add_context(map()) :: :ok
@spec add_context(map() | keyword()) :: :ok
def add_context(data, location \\ :local)

@doc """
Expand All @@ -44,7 +44,7 @@ defmodule Timber do
The second parameter indicates where you want the context to be
stored. See `context_location` for more details.
"""
@spec add_context(map(), context_location) :: :ok
@spec add_context(map() | keyword(), context_location) :: :ok
def add_context(data, :local) do
LocalContext.add(data)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/timber/local_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Timber.LocalContext do
`Timber.Context.add/2` is called to merge the existing context
with the provided context.
"""
@spec add(map()) :: :ok
@spec add(map() | keyword()) :: :ok
def add(context) do
load()
|> Context.merge(context)
Expand Down