From c237223e157c93f5b916c2a99a78b786689ed744 Mon Sep 17 00:00:00 2001 From: Bryce Glover Date: Sat, 5 Dec 2020 13:57:41 -0500 Subject: [PATCH] [Library/Homebrew/cli/named_args.rb] `to_formulae_to_casks()`: Reassociate its `rescue` block with the right enclosing scope. PR #9398 accidentally removed some semantically significant indentation in this function, thus inadvertently kicking the `rescue` block inside out to func- tion scope, when it moved its code further up in the file. This may well not confuse a Ruby interpreter, but it could trip human readers up. Compensate and correct the overlooked offending oversight and potential refactoring mistake by restoring only that indentation, leaving the function in its new location. Refs #9398. --- Library/Homebrew/cli/named_args.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index 16a80ae2c469d..7b5324425931c 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -48,8 +48,8 @@ def to_formulae_and_casks(only: nil, ignore_unavailable: nil, method: nil) @to_formulae_and_casks ||= {} @to_formulae_and_casks[only] ||= downcased_unique_named.flat_map do |name| load_formula_or_cask(name, only: only, method: method) - rescue NoSuchKegError, FormulaUnavailableError, Cask::CaskUnavailableError - ignore_unavailable ? [] : raise + rescue NoSuchKegError, FormulaUnavailableError, Cask::CaskUnavailableError + ignore_unavailable ? [] : raise end.uniq.freeze end