https://github.com/anshap1719/god_mode
https://github.com/anshap1719/god_mode
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/anshap1719/god_mode
- Owner: anshap1719
- Created: 2022-12-23T18:46:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-23T18:54:43.000Z (over 3 years ago)
- Last Synced: 2025-02-15T06:35:19.463Z (over 1 year ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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);
}
```