Macro ok! to replace unwrap


Seen in the tests of the sqlite crate.


examples/macros/macro-ok/src/main.rs
macro_rules! ok(($result:expr) => ($result.unwrap()));

//macro_rules! ok{($result:expr) => ($result.unwrap())}

// macro_rules! ok {
//     ($result:expr) => {
//         $result.unwrap()
//     }
// }

fn main() {
    for input in ["42", "4.2", "23"] {
        let number = ok!(input.parse::<u32>());
        println!("{number}");
    }
}