Merge pull request #20572 from Homebrew/remove-redundant-tbind-pathname

Remove redundant `T.bind(self, Pathname)`
This commit is contained in:
Rylan Polster 2025-08-25 17:52:25 +00:00 committed by GitHub
commit ab33c09687
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,6 @@ module WriteMkpathExtension
def write(content, offset = T.unsafe(nil), external_encoding: T.unsafe(nil), internal_encoding: T.unsafe(nil), def write(content, offset = T.unsafe(nil), external_encoding: T.unsafe(nil), internal_encoding: T.unsafe(nil),
encoding: T.unsafe(nil), textmode: T.unsafe(nil), binmode: T.unsafe(nil), autoclose: T.unsafe(nil), encoding: T.unsafe(nil), textmode: T.unsafe(nil), binmode: T.unsafe(nil), autoclose: T.unsafe(nil),
mode: T.unsafe(nil), perm: T.unsafe(nil)) mode: T.unsafe(nil), perm: T.unsafe(nil))
T.bind(self, Pathname)
raise "Will not overwrite #{self}" if exist? && !offset && !mode&.match?(/^a\+?$/) raise "Will not overwrite #{self}" if exist? && !offset && !mode&.match?(/^a\+?$/)
dirname.mkpath dirname.mkpath