ickb / v1-core

iCKB scripts and utilities for interacting with them
MIT License
2 stars 0 forks source link

Add clippy to rust project #13

Closed XuJiandong closed 2 weeks ago

XuJiandong commented 2 weeks ago

Especially issues like below should be fixed. e.g.

warning: casting a character literal to `u8` truncates
   --> contracts/utils/src/lib.rs:100:40
    |
100 |         || hex_string.as_bytes()[0] != ('0' as u8)
    |                                        ^^^^^^^^^^^ help: use a byte literal instead: `b'0'`
    |
    = note: `char` is four bytes wide, but `u8` is a single byte
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
    = note: `#[warn(clippy::char_lit_as_u8)]` on by default
phroi commented 2 weeks ago

Hey @XuJiandong, thank you for publicly expressing your interest in iCKB by reviewing the L1 scripts source code, I personally appreciate a lot!! 🙏

phroi commented 2 weeks ago

Thanks for the heads-up!! I used clippy to fix automatically and then manually fixed few style warnings. I reviewed the changes and I'm running some tests, so far all good.

@XuJiandong are these changes enough? Do you have any other advice on this?