Crates.io | trust_me_its_safe |
lib.rs | trust_me_its_safe |
version | 0.1.0 |
source | src |
created_at | 2022-12-23 18:55:30.690727 |
updated_at | 2022-12-23 18:55:30.690727 |
description | A macro that replaces unsafe blocks with a friendlier name to not sound as bad |
homepage | |
repository | |
max_upload_size | |
id | 744678 |
size | 1,865 |
A rust macro to replace your unsafe
blocks with a more friendlier (and sarcastic) name in order to not look as bad.
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);
}