god_mode

Crates.iogod_mode
lib.rsgod_mode
version0.1.1
sourcesrc
created_at2022-12-23 18:47:23.787758
updated_at2022-12-23 18:50:57.107576
descriptionA macro that replaces unsafe blocks with a friendlier name to not sound as bad
homepage
repository
max_upload_size
id744674
size1,804
Anshul Sanghi (anshap1719)

documentation

README

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);
}
Commit count: 0

cargo fmt