rustlangtips's profile picture.

Rust Lang Tips

@rustlangtips

Whenever you need to use `unsafe` blocks, reduce the code you put in there to the minimum.


Use `std::ptr::Unique` to wrap owned `*mut T` pointers. s.f87.me/1ueE1rz


Here's a pointer's cheat-sheet. s.f87.me/1BGEKQL


Rust Lang Tips reposted

Rust Lang Tips reposted

Just realized that #rustlang Cell and RefCell are sequential analogues to Atomic and Mutex respectively. That's pretty neat.


Open this link, hit refresh every 10mins. It's one good way to keep up with #rustlang s.f87.me/1jclSlS


Use `box` for allocations instead of `~`. It's clearer and it's the way future rust will look like.


You can do this #rustlang #tips match x { Some(MyVariant(_, true)) => {} None => {} }


This account does not follow anyone
Loading...

Something went wrong.


Something went wrong.