Skip to content

Commit

Permalink
chore: fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Apr 11, 2024
1 parent f0eaedd commit 9363dbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/placeos-driver.cr
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ abstract class PlaceOS::Driver
#
# you can extract index 2 number using: `setting(Int64, :values, 2)`
macro setting(klass, *types)
@__setting__.get { setting({{klass}}, {{*types}}) }
@__setting__.get { setting({{klass}}, {{types.splat}}) }
end

# reads the provided class type out of the settings provided at the provided key.
Expand All @@ -230,7 +230,7 @@ abstract class PlaceOS::Driver
#
# you can extract the public key using: `setting?(String, :keys, :public)`
macro setting?(klass, *types)
@__setting__.get { setting?({{klass}}, {{*types}}) }
@__setting__.get { setting?({{klass}}, {{types.splat}}) }
end

# if you would like to save an updated value to settings so it survives restarts
Expand Down Expand Up @@ -432,7 +432,7 @@ abstract class PlaceOS::Driver

# Support argument lists
if json.raw.is_a?(Array)
arg_names = { {{*args.map(&.name.stringify)}} }
arg_names = { {{args.map(&.name.stringify).splat}} }
args = json.as_a

raise "wrong number of arguments for '#{{{method.name.stringify}}}' (given #{args.size}, expected #{arg_names.size})" if args.size > arg_names.size
Expand Down
2 changes: 1 addition & 1 deletion src/placeos-driver/proxy/drivers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PlaceOS::Driver::Proxy::Drivers
macro method_missing(call)
results = @drivers.map do |driver|
begin
driver.{{call.name.id}}( {{*call.args}} {% if !call.named_args.is_a?(Nop) && call.named_args.size > 0 %}, {{**call.named_args}} {% end %} )
driver.{{call.name.id}}( {{call.args.splat}} {% if !call.named_args.is_a?(Nop) && call.named_args.size > 0 %}, {{call.named_args.double_splat}} {% end %} )
rescue error
::Future::Compute(JSON::Any).new(false) { raise error }
end
Expand Down
2 changes: 1 addition & 1 deletion src/placeos-driver/utilities/rescue_from.cr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class PlaceOS::Driver
{% for klass, details in RESCUE_FROM %}
{% block = details[1] %}
{% if block != nil %}
protected def {{details[0]}}({{*details[1].args}})
protected def {{details[0]}}({{details[1].args.splat}})
{{details[1].body}}
end
{% end %}
Expand Down

0 comments on commit 9363dbe

Please sign in to comment.