google-api-ruby-client icon indicating copy to clipboard operation
google-api-ruby-client copied to clipboard

Add frozen_string_literal to CompositeIO and Multipart

Open allan-pires opened this issue 2 years ago • 1 comments

Description

This adds the magic comment for making string literals frozen on CompositeIO and Multipart. We also utilize the unfrozen string +'' on a few vars to allow the rest of the file to utilize frozen string literals.

Context

There was a deprecation warning for chilled strings merged recently in Ruby: https://github.com/ruby/ruby/commit/12be40ae6be78ac41e8e3f3c313cc6f63e7fa6c4

And with that started to see the following warnings on google-apis-core:

 /vendor/gems/3.4.0/ruby/3.4.0+0/gems/google-apis-core-0.11.3/
 lib/google/apis/core/composite_io.rb:45:in 'String#replace':
/vendor/gems/3.4.0/ruby/3.4.0+0/gems/google-apis-core-0.11.3/
lib/google/apis/core/composite_io.rb:52:in 'Google::Apis::Core::CompositeIO#read':
/vendor/gems/3.4.0/ruby/3.4.0+0/gems/google-apis-core-0.11.3/
lib/google/apis/core/multipart.rb:63:in 'Google::Apis::Core::FilePart#to_io':

allan-pires avatar Apr 10 '24 19:04 allan-pires

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/