Skip to content

Commit

Permalink
Merge pull request #16624 from reitermarkus/avoid-t-must
Browse files Browse the repository at this point in the history
Avoid `T.must`.
  • Loading branch information
reitermarkus committed Feb 10, 2024
2 parents 8b69b89 + 5cc1ddc commit 73f1629
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -540,23 +540,13 @@ def oldname
# Old names for the formula.
sig { returns(T::Array[String]) }
def oldnames
@oldnames ||= if tap
T.must(tap).formula_oldnames.fetch(name, [])
else
[]
end
@oldnames ||= tap&.formula_oldnames&.dig(name) || []
end

# All aliases for the formula.
sig { returns(T::Array[String]) }
def aliases
@aliases ||= if tap
T.must(tap).alias_reverse_table[full_name].to_a.map do |a|
a.split("/").last
end
else
[]
end
@aliases ||= tap&.alias_reverse_table&.dig(full_name)&.map { _1.split("/").last } || []
end

# The {Resource}s for the currently active {SoftwareSpec}.
Expand Down

0 comments on commit 73f1629

Please sign in to comment.