Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent String mutation #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrbeck
Copy link

@jrbeck jrbeck commented Nov 18, 2022

We had a bug with frozen Strings. It's not clear that the stripping was also mutating, and it was failing silently on the frozen String. I figure there are basically 2 ways to go here: raise on the frozen String or dup the String.

As I see no reason to expect that this method mutates the String (ie it's not a bang method like the gsub! that actually mutates), the dup method seems appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant