From 37329d3be78e6a1107b2fe0a71b8ba1210db0635 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 13 Oct 2021 21:50:37 -0500 Subject: [PATCH] Additional fixes for rubocop 1.10.1 This is the default rubocop in Guix. --- lib/bwmsgsv2_repo.rb | 2 +- lib/command.rb | 2 +- lib/customer_usage.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bwmsgsv2_repo.rb b/lib/bwmsgsv2_repo.rb index b295ff1..daf29e2 100644 --- a/lib/bwmsgsv2_repo.rb +++ b/lib/bwmsgsv2_repo.rb @@ -68,7 +68,7 @@ protected ibr.from = from_jid IQ_MANAGER.write(ibr).catch { nil }.then do |result| - if result&.respond_to?(:registered?) && result&.registered? + if result.respond_to?(:registered?) && result.registered? result else false diff --git a/lib/command.rb b/lib/command.rb index 6abb230..30b69d9 100644 --- a/lib/command.rb +++ b/lib/command.rb @@ -112,7 +112,7 @@ class Command next EMPromise.reject(iq) unless iq.cancel? finish(status: :canceled) - }.catch_only(Timeout) {}.catch_only(FinalStanza) { |e| + }.catch_only(Timeout) { nil }.catch_only(FinalStanza) { |e| @blather << e.stanza }.catch do |e| log_error(e) diff --git a/lib/customer_usage.rb b/lib/customer_usage.rb index a6aa1ec..a02dc45 100644 --- a/lib/customer_usage.rb +++ b/lib/customer_usage.rb @@ -50,7 +50,7 @@ class CustomerUsage "jmp_customer_outbound_messages-#{@customer_id}", day.strftime("%Y%m%d") ).then { |c| [day, c.to_i] if c } - }).then { |r| Hash[r.compact].tap { |h| h.default = 0 } } + }).then { |r| r.compact.to_h.tap { |h| h.default = 0 } } end QUERY_FOR_MINUTES = <<~SQL -- 2.38.5