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 manual_assert #62

Open
0xLucqs opened this issue Sep 17, 2024 · 3 comments
Open

Add manual_assert #62

0xLucqs opened this issue Sep 17, 2024 · 3 comments
Labels
good first issue Good for newcomers lint

Comments

@0xLucqs
Copy link
Contributor

0xLucqs commented Sep 17, 2024

What it does

Detects if-then-panic! that can be replaced with assert!.

Why is this bad?

assert! is simpler than if-then-panic!.

Example

let sad_people: Array<&str> = arrray![];
if !sad_people.is_empty() {
    panic!("there are sad people: {:?}", sad_people);
}

Use instead:

let sad_people: Array<&str> = array![];
assert!(sad_people.is_empty(), "there are sad people: {:?}", sad_people);

https://rust-lang.github.io/rust-clippy/master/index.html#/manual_assert

@0xLucqs 0xLucqs added good first issue Good for newcomers lint labels Sep 17, 2024
@stevencartavia
Copy link
Contributor

Hi, I would like to work on this!

Copy link

onlydustapp bot commented Sep 17, 2024

Hey @stevencartavia!
Thanks for showing interest.
We've created an application for you to contribute to Cairo lint.
Go check it out on OnlyDust!

@0xLucqs
Copy link
Contributor Author

0xLucqs commented Sep 17, 2024

let's go!

@mkaput mkaput added this to cairo-lint Dec 9, 2024
@github-project-automation github-project-automation bot moved this to Triage in cairo-lint Dec 9, 2024
@mkaput mkaput moved this from Triage to Backlog in cairo-lint Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers lint
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants