Skip to content

Commit 9d3fd51

Browse files
author
Ary Borenszweig
committedFeb 10, 2017
HTTP::Client: make sure exec returns the type of the block (without nil)
1 parent 4b3a852 commit 9d3fd51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/http/client.cr

+3-3
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ class HTTP::Client
523523
end
524524
end
525525

526-
private def exec_internal(request, &block)
526+
private def exec_internal(request, &block : Response -> T) : T forall T
527527
exec_internal_single(request) do |response|
528528
if response
529529
return handle_response(response) { yield response }
@@ -538,10 +538,10 @@ class HTTP::Client
538538
yield response
539539
end
540540
end
541-
542-
raise "unexpected end of http response"
543541
end
544542
end
543+
544+
raise "unexpected end of http response"
545545
end
546546

547547
private def exec_internal_single(request)

0 commit comments

Comments
 (0)