Prefer String#b over force_encoding and avoid mutating strings#2659
Open
byroot wants to merge 1 commit into
Open
Prefer String#b over force_encoding and avoid mutating strings#2659byroot wants to merge 1 commit into
force_encoding and avoid mutating strings#2659byroot wants to merge 1 commit into
Conversation
Author
|
Sorry, I meant to open this against |
Member
|
Actually |
Author
Right, but then not sure my patch work, it's not based on the right branch. It also assume Ruby 1.9+, but it seems on 6-1-stable
I just sent the mail with the PDF. |
Member
|
ruby 2.5 is definitely required for stable-6.1. |
Author
|
Alright, I'll clean the PR then! |
I started recording deprecation warning in production in the hope to enable Ruby's `--enable-frozen-string-literal`, but ran into two string literal deprecation warnings coming from passenger, one of which is: ``` src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:90: warning: literal string will be frozen in the future ``` Since passenger requires Ruby 2.5, all these check for `force_encoding` are useless, we can assume the presence of `String#b`.
Author
|
Should be good to go. I also have a followup commit to make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I started recording deprecation warning in production in the hope to enable Ruby's
--enable-frozen-string-literal, but ran into two string literal deprecation warnings coming from passenger, one of which is:Since passenger requires Ruby 2.5, all these check for
force_encodingare useless, we can assume the presence ofString#b.