rustoftheday Profile Banner
Daily Rust Profile
Daily Rust

@rustoftheday

Followers
3K
Following
700
Media
129
Statuses
442

Daily tips & tricks for Rust 🦀 programming. Following back all accounts with 🦀 or 🐪 in their profile.

Joined November 2023
Don't wanna be here? Send us removal request.
@abshekha
Abhimanyu Shekhawat
6 days
🥵
7
16
177
@rustoftheday
Daily Rust
7 days
🦀 #Rust Tip #117: fn foo(&self) fn bar (&mut self) fn baz (self) fn boo (mut self) Confused about which one to use in your struct implementations? Here's a useful overview:
8
14
160
@bytetwt
byte.sol — e/acc
24 days
Rust's async is beautiful chaos 😮‍💨 Most languages hide concurrency complexity. Rust makes you face it and that's why it's faster. Looks simple - async fn fetch_data() { let result = api_call().await; } But under the hood? Rust compiles this into a state machine.
18
14
183
@rustoftheday
Daily Rust
24 days
🦀 #Rust Tip #116: Most of us should know Mutex<> for locking access to specific resources. However, this does also require locking the resources for read. If you need concurrent access to read, take a look at RwLock<> https://t.co/luPgDHcRSk
1
0
6
@rustoftheday
Daily Rust
1 month
Note: the reason to_uppercase() returns an iterator is that some characters capitalize to two chars. E.g., "ffi" (Unicode) to "FFI"
1
0
4
@rustoftheday
Daily Rust
1 month
🦀 #Rust Tip #115: Here's an interesting self-referential use of iterators, from Rustlings ( https://t.co/qP5zEIFTd0, highly recommended for Rust learners). We get an iterator that capitalizes the char, then use the chain() operator to attach the rest of the string chars.
4
6
100
@rustoftheday
Daily Rust
2 months
"Cargo is the most admired cloud development and infrastructure tool" in 2025, says a Stack Overflow study. https://t.co/o6WBpkaEoO
2
4
20
@rustoftheday
Daily Rust
2 months
🦀 #Rust Tip #114: A serde tip: #[serde(flatten)] can be used to beautify Json output when serializing. This is useful to improve the handling of enums in particular:
0
0
16
@rustoftheday
Daily Rust
2 months
An amazing overview of the core Rust types and traits: https://t.co/Ak9SANexqK
rustcurious.com
A complete map of the Rust type system
1
21
161
@rustoftheday
Daily Rust
3 months
🦀 #Rust Tip #113: https://t.co/BunGWrJlNN is secretly a decent C build system. You can compile wrappers + link C SDKs for Rust wrappers and calling into C code. BTW those println!s are "hidden" build instructions to Cargo. Who needs Makefiles? 🦀
0
9
114
@rustoftheday
Daily Rust
3 months
🦀 #Rust Tip #112: Rust will happily compile and call C functions in unsafe mode. Just declare them in an extern "C" block. Great for interop with legacy code or standard library C functions.
4
13
143
@rustoftheday
Daily Rust
3 months
🦀 #Rust Tip #111: You can use the examples/ directory in your crate and cargo run --example <name> to run quick experimentations, demos or tests without affecting your https://t.co/OlqnBdRobN file.
0
2
35
@rustoftheday
Daily Rust
3 months
🦀 #Rust Tip #110: Rust 2024 edition allows if let Some() chaining. Finally!
4
11
175
@rustoftheday
Daily Rust
4 months
Sorry this was actually #Rust Tip #109, my bad.
2
0
10
@rustoftheday
Daily Rust
4 months
🦀 #Rust Tip #108: A (new to me) function of Cargo is "cargo check". Use this to turbocharge your edit-compile cycles as cargo check runs type checking only but skips codegen and linking. Great for sorting out those borrow-checker issues 🧠
5
6
80
@rustoftheday
Daily Rust
5 months
If they had just used #Rust ... No null pointers!
@Goosewin
goosewin
5 months
null pointer was the culprit that took down google 😭
1
0
10
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #108: I always enjoy the power of Rust #iterators. Here are two utility functions that you might not know about: .peekable() : Allow peeking at next element without consuming it .partition(cond_fn): Partition an iterator into separate collections with a condition
0
10
159
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #107: TIL about the #[cold] attribute for functions that don't get called very often. This helps the compiler prioritize hot path functions for better instruction cache performance. #[cold] can also be used to tag enum variants to optimize memory layout.
5
23
385
@swlkr
swlkr
5 months
when you write a rust app, no tests, and it works first try
16
25
555
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #106: Boxing large enum values can be beneficial to save stack space and to prevent recursion-bombs 💣, by moving these payloads to the heap.
0
11
150