From 8fb5be2a427bf475ae51861f4e48f42fb3adab1e Mon Sep 17 00:00:00 2001 From: Serdar Dogruyol Date: Tue, 5 Sep 2017 12:03:37 +0300 Subject: [PATCH] Remove redundant casts --- src/kemal/exceptions.cr | 2 +- src/kemal/ext/context.cr | 2 +- src/kemal/param_parser.cr | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kemal/exceptions.cr b/src/kemal/exceptions.cr index 95bca29..327a9d1 100644 --- a/src/kemal/exceptions.cr +++ b/src/kemal/exceptions.cr @@ -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 diff --git a/src/kemal/ext/context.cr b/src/kemal/ext/context.cr index c466fe3..b0af1d0 100644 --- a/src/kemal/ext/context.cr +++ b/src/kemal/ext/context.cr @@ -33,7 +33,7 @@ class HTTP::Server end def route - route_lookup.payload.as(Kemal::Route) + route_lookup.payload end def route_lookup diff --git a/src/kemal/param_parser.cr b/src/kemal/param_parser.cr index 57e1ab9..e2a4ca8 100644 --- a/src/kemal/param_parser.cr +++ b/src/kemal/param_parser.cr @@ -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