Skip to content

Add lint for "string literal".as_bytes() #562

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 2 commits into from
Jan 19, 2016

Conversation

fhartwig
Copy link
Contributor

Fixes #560

I've made this Warn by default because I think byte string literals should be strictly preferred. Let me know if you think it should be Allow, since this is somewhat subjective.

@llogiq
Copy link
Contributor

llogiq commented Jan 19, 2016

I think this needs a macro check. Apart from that I'm OK with warning.

@Manishearth
Copy link
Member

r+ w/ macro check

@fhartwig
Copy link
Contributor Author

@llogiq You're right. Done.

@llogiq
Copy link
Contributor

llogiq commented Jan 19, 2016

I'd actually use in_macro – this is about readability, and even in internal macros, using .as_bytes() may make the meaning more clear. Apart from that, r+.

@fhartwig
Copy link
Contributor Author

@llogiq Right, sorry. I somehow didn't see in_macro. Fixed.

llogiq added a commit that referenced this pull request Jan 19, 2016
Add lint for "string literal".as_bytes()
@llogiq llogiq merged commit 6fa49eb into rust-lang:master Jan 19, 2016
@llogiq
Copy link
Contributor

llogiq commented Jan 19, 2016

Thank you! 👍

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.

3 participants