keep-starknet-strange / cairo-lint

A collection of lints to catch common mistakes and improve your Cairo code.
21 stars 35 forks source link

Add manual_unwrap_or_default #86

Closed JoE11-y closed 2 months ago

JoE11-y commented 2 months ago

Completed #67

JoE11-y commented 2 months ago

I've made the changes and added new tests to handle fixed arrays and tuples.

0xLucqs commented 2 months ago

fix clippy errors and it's good to go

JoE11-y commented 2 months ago

fix clippy errors and it's good to go

Just did.

JoE11-y commented 2 months ago

@0xLucqs Test error was caused by iter().all() returning true for an empty iterator, I've refactored the code to use a for loop instead.

https://github.com/JoE11-y/cairo-lint/blob/main/crates/cairo-lint-core/src/lints/manual/manual_unwrap_or_default.rs#L130

0xLucqs commented 1 month ago

@all-contributors please add @JoE11-y for code and tests

allcontributors[bot] commented 1 month ago

@0xLucqs

I've put up a pull request to add @JoE11-y! :tada: