Misc: Use #splat method for macro expressions (#4242)

This commit is contained in:
Samantaz Fox 2023-12-06 18:22:50 +01:00
commit 37c2f5caed
No known key found for this signature in database
GPG Key ID: F42821059186176E
3 changed files with 5 additions and 5 deletions

View File

@ -93,7 +93,7 @@ struct ChannelVideo
def to_tuple
{% begin %}
{
{{*@type.instance_vars.map(&.name)}}
{{@type.instance_vars.map(&.name).splat}}
}
{% end %}
end

View File

@ -48,7 +48,7 @@ struct ConfigPreferences
def to_tuple
{% begin %}
{
{{*@type.instance_vars.map { |var| "#{var.name}: #{var.name}".id }}}
{{(@type.instance_vars.map { |var| "#{var.name}: #{var.name}".id }).splat}}
}
{% end %}
end

View File

@ -3,7 +3,7 @@
# -------------------
macro error_template(*args)
error_template_helper(env, {{*args}})
error_template_helper(env, {{args.splat}})
end
def github_details(summary : String, content : String)
@ -95,7 +95,7 @@ end
# -------------------
macro error_atom(*args)
error_atom_helper(env, {{*args}})
error_atom_helper(env, {{args.splat}})
end
def error_atom_helper(env : HTTP::Server::Context, status_code : Int32, exception : Exception)
@ -121,7 +121,7 @@ end
# -------------------
macro error_json(*args)
error_json_helper(env, {{*args}})
error_json_helper(env, {{args.splat}})
end
def error_json_helper(