Avoid modifying frozen string literals #1364
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given MRI 3.4 will have a warning whenever frozen string literals are edited, this PR fixes up the two situations where I expect that to happen.
I've tried to modify the CI workflows to have frozen string literals enforced, but the relevant RUBYOPT flags (
--enable-frozen-string-literal --debug-frozen-string-literal
) can't be used in old Ruby versions (<= 2.3) and so setting it globally is not an option - though it did turn up the frozen string in the client spec.Annoyingly, setting RUBYOPT conditionally (like is done with other variables) doesn't work either - I think it gets stuck somewhere within rake-compiler, but given that it works in modern Ruby versions when the env is set globally, this inconsistency is especially odd.
Anyway: I figure it's worth having this PR around for now, and the CI wrangling can be sorted another time.