Skip to content

Commit

Permalink
fix the typespec of Request.update: accept Hui.U struct in addition t…
Browse files Browse the repository at this point in the history
…o binary update commands
  • Loading branch information
boonious committed Oct 8, 2018
1 parent 8de8ba4 commit b08a979
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hui/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ defmodule Hui.Request do
See [Solr reference](http://lucene.apache.org/solr/guide/uploading-data-with-index-handlers.html)
for more details on various data commands, types and formats.
"""
@spec update(solr_url, boolean, binary) :: {:ok, HTTPoison.Response.t} | {:error, Hui.Error.t} | HTTPoison.Response.t
@spec update(solr_url, boolean, binary | Hui.U.t) :: {:ok, HTTPoison.Response.t} | {:error, Hui.Error.t} | HTTPoison.Response.t
def update(url, bang \\ false, data)
def update(%Hui.URL{} = url, bang, data) when is_binary(data), do: _update(url, bang, data)
def update(%Hui.URL{} = url, bang, %Hui.U{} = data), do: _update(url, bang, data |> Hui.U.encode)
Expand Down

0 comments on commit b08a979

Please sign in to comment.