Skip to content

Commit

Permalink
HTTP::Client: make sure exec returns the type of the block (without nil)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ary Borenszweig committed Feb 10, 2017
1 parent 4b3a852 commit 9d3fd51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/http/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ class HTTP::Client
end
end

private def exec_internal(request, &block)
private def exec_internal(request, &block : Response -> T) : T forall T
exec_internal_single(request) do |response|
if response
return handle_response(response) { yield response }
Expand All @@ -538,10 +538,10 @@ class HTTP::Client
yield response
end
end

raise "unexpected end of http response"
end
end

raise "unexpected end of http response"
end

private def exec_internal_single(request)
Expand Down

0 comments on commit 9d3fd51

Please sign in to comment.