Skip to content

Add new Literal::str_value, Literal::cstr_value and Literal::byte_str_value methods #504

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

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

Conversation

GuillaumeGomez
Copy link

@GuillaumeGomez GuillaumeGomez commented Jun 24, 2025

Since rust-lang/rust#139367 was merged a while ago, I think it's ok to start making use of it as a nightly experiment if you're ok with it.

If this PR is merged, I plan to send a follow-up on syn for Literal::value to make use of these methods instead (when nightly feature is enabled) so the unescaping source code could be cfg-ed out.

Hopefully, when the API gets stabilized, we could get some nice numbers on compilation improvements for a lot of crates (although minor, considering how much your crates are used, definitely worth it).

So what do you think?

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.

1 participant