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

Add useless_concat #13793

Open
sorairolake opened this issue Dec 7, 2024 · 0 comments
Open

Add useless_concat #13793

sorairolake opened this issue Dec 7, 2024 · 0 comments
Labels
A-lint Area: New lints

Comments

@sorairolake
Copy link

sorairolake commented Dec 7, 2024

What it does

Checks for the use of concat!("takes a single string literal").

Advantage

Redundant code. The type of a literal yielded by concat! and the type of a string literal are both &'static str.

Drawbacks

No response

Example

let foo = concat!("foo");

Could be written as:

let foo = "foo";
@sorairolake sorairolake added the A-lint Area: New lints label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

1 participant