#replace #bad #unsafe #name #blocks #macro #friendlier

yanked god_mode

A macro that replaces unsafe blocks with a friendlier name to not sound as bad

2 releases

0.1.1 Dec 23, 2022
0.1.0 Dec 23, 2022

#33 in #bad

Apache-2.0

2KB

god_mode

A rust macro to replace your unsafe blocks with a more friendlier name in order to not look as bad.

Usage Examples

Instead of

fn main() {
    let mut x = 2.;
    let pointer = &mut x as *mut f64;

    unsafe {
        *pointer = 6.3;
    }

    println!("{}", x);
}

just use

fn main() {
    let mut x = 2.;
    let pointer = &mut x as *mut f64;

    god_mode! {{
        *pointer = 6.3;
    }}

    println!("{}", x);
}

No runtime deps