Skip to content

Commit

Permalink
Address ameba warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ellmetha committed Dec 7, 2024
1 parent 8191e04 commit 09dd5c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/marten.cr
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,13 @@ module Marten
base_message = "Marten running on #{Marten::Server.addresses.join ", "} (Press CTRL+C to quit)"

if Marten.settings.debug?
Log.info {
Log.info do
String.build do |s|
s << "#{"=" * base_message.size}\n"
s << base_message
s << "\n#{"=" * base_message.size}"
end
}
end
else
Log.info { base_message }
end
Expand Down
5 changes: 3 additions & 2 deletions src/marten/db/query/sql/predicate_node.cr
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ module Marten
def replace_table_alias_prefix(old_vs_new_table_aliases : Hash(String, String)) : Nil
return unless filter_predicates?

filter_predicates.each { |p|
filter_predicates.each do |p|
next unless old_vs_new_table_aliases.has_key?(p.alias_prefix)
p.alias_prefix = old_vs_new_table_aliases[p.alias_prefix]
}
end

@children.each { |c| c.replace_table_alias_prefix(old_vs_new_table_aliases) }
end

Expand Down
4 changes: 2 additions & 2 deletions src/marten/server/handlers/logger.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module Marten

def call(context : ::HTTP::Server::Context)
duration = Time.measure { call_next(context) }
Log.info {
Log.info do
"\"#{context.request.method} #{context.request.path}\" " \
"#{context.response.status_code} - #{duration.total_milliseconds}ms"
}
end
end
end
end
Expand Down

0 comments on commit 09dd5c0

Please sign in to comment.