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
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

View file

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

View file

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