keep-starknet-strange / cairo-lint

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

Add `erasing_op` #17

Open 0xLucqs opened 1 month ago

0xLucqs commented 1 month ago

What it does

Checks for erasing operations, e.g., x * 0.

Why is this bad?

The whole expression can be replaced by zero. This is most likely not the intended outcome and should probably be corrected

Example

let x = 1;
0 / x;
0 * x;
x & 0;

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

CristopherAguilar10 commented 1 month ago

hello @0xLucqs can i work in this issue?

0xLucqs commented 1 month ago

sure and i can help if you're stuck or don't know how to start don't hesitate to ping me

CristopherAguilar10 commented 1 month ago

ok, thanks for the opportunity