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

Feat: add comparison_to_empty #130

Closed

Conversation

Benjtalkshow
Copy link

@Benjtalkshow Benjtalkshow commented Sep 30, 2024

closes #74
@0xLucqs
This is a draft PR

Implementation

Checks for comparing to an empty slice such as [], and suggests using .is_empty() where applicable.

@Benjtalkshow Benjtalkshow marked this pull request as draft September 30, 2024 19:32
@Benjtalkshow Benjtalkshow marked this pull request as ready for review September 30, 2024 20:24
Comment on lines 40 to 42
fn create_diagnostic(message: &str, stable_ptr: SyntaxStablePtrId, severity: Severity) -> PluginDiagnostic {
PluginDiagnostic { stable_ptr, message: message.to_string(), severity }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need this function, directly create the diagnostic

@@ -11,3 +11,4 @@ pub mod loops;
pub mod manual;
pub mod panic;
pub mod single_match;
// pub mod comparison_to_empty;
Copy link
Contributor

Choose a reason for hiding this comment

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

uncomment that

@Benjtalkshow
Copy link
Author

Alright @0xLucqs

@Benjtalkshow
Copy link
Author

@0xLucqs i have made the requested changes

@0xLucqs
Copy link
Contributor

0xLucqs commented Oct 1, 2024

fix clippy and don't forget to format

@Benjtalkshow
Copy link
Author

fix clippy and don't forget to format

ok

@0xLucqs
Copy link
Contributor

0xLucqs commented Oct 1, 2024

you need to add the tests to the test file similarly to how it's done with others

@Benjtalkshow
Copy link
Author

@0xLucqs
Please i just implemented the changes

@0xLucqs
Copy link
Contributor

0xLucqs commented Oct 2, 2024

fix the tests, remove the useless added file and restore the cargo.lock plz

@0xLucqs
Copy link
Contributor

0xLucqs commented Oct 2, 2024

and resolve conflicts

@Benjtalkshow
Copy link
Author

fix the tests, remove the useless added file and restore the cargo.lock plz

alright

@0xLucqs 0xLucqs closed this Oct 7, 2024
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.

Add comparison_to_empty
2 participants