Crates.io | god_mode |
lib.rs | god_mode |
version | 0.1.1 |
source | src |
created_at | 2022-12-23 18:47:23.787758 |
updated_at | 2022-12-23 18:50:57.107576 |
description | A macro that replaces unsafe blocks with a friendlier name to not sound as bad |
homepage | |
repository | |
max_upload_size | |
id | 744674 |
size | 1,804 |
A rust macro to replace your unsafe
blocks with a more friendlier 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;
god_mode! {{
*pointer = 6.3;
}}
println!("{}", x);
}