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

このコミットが含まれているのは:
Samantaz Fox 2023-12-06 18:22:50 +01:00
コミット 37c2f5caed
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: F42821059186176E
3個のファイルの変更5行の追加5行の削除

ファイルの表示

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

ファイルの表示

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

ファイルの表示

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