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
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
🦀 #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
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
🦀 #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
"Cargo is the most admired cloud development and infrastructure tool" in 2025, says a Stack Overflow study. https://t.co/o6WBpkaEoO
2
4
20
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
🦀 #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
🦀 #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
4
11
175
If they had just used #Rust ... No null pointers!
1
0
10
🦀 #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