Skip to content

Escape control #22928

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

Closed
wants to merge 5 commits into from
Closed

Escape control #22928

wants to merge 5 commits into from

Conversation

LukasKalbertodt
Copy link
Member

Add escape_control to char and str: Escapes C0 and C1 control chars. When printing chars or strs via {:?} the Debug-implementation will use those methods instead of escape_default.
Fixes #22412 (?)

This is my first PR, I hope everything is ok...

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@@ -585,4 +639,4 @@ impl Iterator for EscapeDefault {
EscapeDefaultState::Unicode(ref mut iter) => iter.next()
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Accidentally removed trailing newline.

@alexcrichton
Copy link
Member

Thanks for the PR! At this stage of Rust, however, all new APIs require an RFC for inclusion into the standard library. New APIs also start out as #[unstable] after being accepted via an RFC and only later will they be maked as #[stable] (typically at least a release cycle).

For moving forward here this would need to open an RFC for the addition of these APIs. Feel free to let me know if you need any help writing an RFC, I'd be more than willing to review any drafts!

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.

{:?} should not escape printable characters
5 participants