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

Fix symbol and string literal types' to_s #1316

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

Conversation

pocke
Copy link
Member

@pocke pocke commented Apr 24, 2023

No description provided.

@pocke pocke force-pushed the Fix_symbol_and_string_literal_types___to_s_ branch from a089c4f to 5ae16b3 Compare April 24, 2023 09:12

def string_to_s(str)
content = str.chars.map do |c|
case c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldnt a hash and [] work better? like str.chars.map { |c| SPECIAL_CHARS.fetch(c, c) } ?

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

Successfully merging this pull request may close these issues.

2 participants