trust_me_its_safe

Crates.iotrust_me_its_safe
lib.rstrust_me_its_safe
version0.1.0
sourcesrc
created_at2022-12-23 18:55:30.690727
updated_at2022-12-23 18:55:30.690727
descriptionA macro that replaces unsafe blocks with a friendlier name to not sound as bad
homepage
repository
max_upload_size
id744678
size1,865
Anshul Sanghi (anshap1719)

documentation

README

trust_me_its_safe

A rust macro to replace your unsafe blocks with a more friendlier (and sarcastic) 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;

    trust_me_its_safe! {{
        *pointer = 6.3;
    }}

    println!("{}", x);
}
Commit count: 0

cargo fmt