diff --git a/src/crest/params_encoders/enumerated_flat_params_encoder.cr b/src/crest/params_encoders/enumerated_flat_params_encoder.cr index 1af74f18..107ba2c3 100644 --- a/src/crest/params_encoders/enumerated_flat_params_encoder.cr +++ b/src/crest/params_encoders/enumerated_flat_params_encoder.cr @@ -19,9 +19,7 @@ module Crest # # => [{"key1[key2]", "123"}] # ``` def self.flatten_params(object : Hash, parent_key : String? = nil) : Array(Tuple(String, Crest::ParamsValue)) - object.reduce([] of Tuple(String, Crest::ParamsValue)) do |memo, item| - k, v = item - + object.reduce([] of Tuple(String, Crest::ParamsValue)) do |memo, (k, v)| processed_key = parent_key ? "#{parent_key}[#{k}]" : k.to_s case v diff --git a/src/crest/params_encoders/flat_params_encoder.cr b/src/crest/params_encoders/flat_params_encoder.cr index 73bdce40..e0bc42a4 100644 --- a/src/crest/params_encoders/flat_params_encoder.cr +++ b/src/crest/params_encoders/flat_params_encoder.cr @@ -24,9 +24,7 @@ module Crest # # => [{"key1[key2]", "123"}] # ``` def self.flatten_params(object : Hash, parent_key : String? = nil) : Array(Tuple(String, Crest::ParamsValue)) - object.reduce([] of Tuple(String, Crest::ParamsValue)) do |memo, item| - k, v = item - + object.reduce([] of Tuple(String, Crest::ParamsValue)) do |memo, (k, v)| processed_key = parent_key ? "#{parent_key}[#{k}]" : k.to_s case v diff --git a/src/crest/params_encoders/nested_params_encoder.cr b/src/crest/params_encoders/nested_params_encoder.cr index 20cc8f29..4eb120f0 100644 --- a/src/crest/params_encoders/nested_params_encoder.cr +++ b/src/crest/params_encoders/nested_params_encoder.cr @@ -24,9 +24,7 @@ module Crest # # => [{"key1[key2]", "123"}] # ``` def self.flatten_params(object : Hash, parent_key : String? = nil) : Array(Tuple(String, Crest::ParamsValue)) - object.reduce([] of Tuple(String, Crest::ParamsValue)) do |memo, item| - k, v = item - + object.reduce([] of Tuple(String, Crest::ParamsValue)) do |memo, (k, v)| processed_key = parent_key ? "#{parent_key}[#{k}]" : k.to_s case v