Skip to content

feat(assists): raw string <-> usual string manipulation #1850

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

Merged
merged 5 commits into from
Sep 20, 2019

Conversation

Geobert
Copy link
Contributor

@Geobert Geobert commented Sep 15, 2019

Fixes #1730

@Geobert
Copy link
Contributor Author

Geobert commented Sep 19, 2019

uh, I don't know what I've done with git Oo

EDIT: fixed

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

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

bors r+

Thanks!

let start_of_inside = usual_string_range.start().to_usize() + 1;
let end_of_inside = usual_string_range.end().to_usize();
let inside_str = &text[start_of_inside..end_of_inside];
let escaped = inside_str.escape_default().to_string();
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I haven't realized that we can lean on escape_default here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me neither x) I was looking on what's available to achieve the work and stumble upon this :D

bors bot added a commit that referenced this pull request Sep 20, 2019
1850: feat(assists): raw string <-> usual string manipulation r=matklad a=Geobert

Fixes #1730

Co-authored-by: Geobert Quach <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 20, 2019

Build succeeded

@bors bors bot merged commit ce4d843 into rust-lang:master Sep 20, 2019
@Geobert Geobert deleted the raw-string-assists branch September 21, 2019 14:19
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.

Raw string assists
3 participants