Remove redundant casts

This commit is contained in:
Serdar Dogruyol 2017-09-05 12:03:37 +03:00
parent 1c069ab643
commit 8fb5be2a42
3 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ module Kemal::Exceptions
class RouteNotFound < Exception class RouteNotFound < Exception
def initialize(context : HTTP::Server::Context) def initialize(context : HTTP::Server::Context)
super "Requested path: '#{context.request.override_method.as(String)}:#{context.request.path}' was not found." super "Requested path: '#{context.request.override_method}:#{context.request.path}' was not found."
end end
end end

View file

@ -33,7 +33,7 @@ class HTTP::Server
end end
def route def route
route_lookup.payload.as(Kemal::Route) route_lookup.payload
end end
def route_lookup def route_lookup

View file

@ -60,7 +60,7 @@ module Kemal
private def parse_url private def parse_url
if params = @request.url_params if params = @request.url_params
params.each do |key, value| params.each do |key, value|
@url[key.as(String)] = unescape_url_param(value).as(String) @url[key] = unescape_url_param(value)
end end
end end
end end
@ -88,7 +88,7 @@ module Kemal
case json = JSON.parse(body).raw case json = JSON.parse(body).raw
when Hash when Hash
json.each do |key, value| json.each do |key, value|
@json[key.as(String)] = value.as(AllParamTypes) @json[key] = value.as(AllParamTypes)
end end
when Array when Array
@json["_json"] = json @json["_json"] = json