keep-starknet-strange / cairo-lint

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

feat: manual_ok and manual_err #133

Closed chachaleo closed 3 weeks ago

chachaleo commented 3 weeks ago

Incorrect behaviour modified :

this :

fn main() {
    let foo: Option<i32> = Option::None;
    let other_val = 0;
    let _foo = match foo {
        Option::Some(_) => Result::Ok(other_val),
        Option::None => Result::Err('this is an err'),
    };
}

was incorrectly fixed to this :

fn main() {
    let foo: Option<i32> = Option::None;
    let other_val = 0;
    let _foo = foo.ok_or('this is an err')
}
0xLucqs commented 3 weeks ago

faut rebase aussi