rustoftheday Profile Banner
Daily Rust Profile
Daily Rust

@rustoftheday

Followers
3K
Following
667
Media
122
Statuses
412

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.
@rustoftheday
Daily Rust
18 days
If they had just used #Rust . No null pointers!.
@dan_goosewin
goosewin
21 days
null pointer was the culprit that took down google 😭
Tweet media one
1
0
10
@rustoftheday
Daily Rust
25 days
🦀 #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
Tweet media one
0
9
158
@rustoftheday
Daily Rust
28 days
🦀 #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.
Tweet media one
5
25
391
@rustoftheday
Daily Rust
1 month
RT @swlkr: when you write a rust app, no tests, and it works first try
Tweet media one
0
25
0
@rustoftheday
Daily Rust
1 month
🦀 #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.
Tweet media one
0
11
149
@rustoftheday
Daily Rust
1 month
This looks like there is finally a (usable) #debugger for #Rust . Worth checking out?.
0
5
30
@rustoftheday
Daily Rust
1 month
🦀 #Rust Tip #105:. Want to make sure your loop breaks out to a specific level? Rust allows using labels to finetune the exit point:
Tweet media one
7
12
237
@rustoftheday
Daily Rust
2 months
A bit "schoolmasterly" but some good tips on learning Rust
0
7
61
@rustoftheday
Daily Rust
3 months
🦀 #Rust #Crate 22: Are you dissatisfied with the performance hit of your println! debugging output? Do you think env_logger is boring? . Turbocharge your log outputs with high performance and fine-grained structured control using the tracing crate:
Tweet media one
0
7
60
@rustoftheday
Daily Rust
3 months
🦀 #Rust Tip #105: .Searching for ways to allow a warning I learned that there are "inner" and "outer" attributes. - Inner #![. ] applies broadly to the whole module or crate:. #![allow(dead_code)] . - Outer #[. ] applies to the following item:. #[derive(Debug)].
0
1
14
@rustoftheday
Daily Rust
4 months
RT @AstraKernel: Lol 😆
Tweet media one
0
7
0
@rustoftheday
Daily Rust
4 months
RT @LiamWoodleigh: @rustoftheday @tsoding C++ and memory unsafe languages should be considered deprecated.
0
1
0
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #104: .This is a nice one: Have you ever tried to compare the variant of two enums? Usually this requires a cascade of match statements. However, mem::discriminant can be used in this situation. This works specifically in cases where the enum doesn't derive Eq.
Tweet media one
4
20
397
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #103: . Want to spawn threads without managing handles?. std::thread::scope blocks until all threads terminate within the defined closure. Example:
Tweet media one
5
16
251
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #102: Use the #[track_caller] macro to make panics report the call-site instead of the function itself. Great for debugging wrappers & assertions!
Tweet media one
2
10
253
@rustoftheday
Daily Rust
5 months
I you're into #Robotics , and working with ROS2 specifically, look into the R2R crate:
0
2
18
@rustoftheday
Daily Rust
5 months
Working with chrono + chrono-tz in #Rust? Brace for confusion! 🌍⏳. chrono-tz::Tz is both a type and a value, but chrono prefers FixedOffset and Utc, making conversions unintuitive. For a language as elegant as Rust, time handling feels oddly clunky.
1
0
9
@rustoftheday
Daily Rust
5 months
🦀 #Rust Tip #101:.Hard to believe that the Rust compiler can also help find errors in your SQL at compile time. Just check out the SQLX crate!
Tweet media one
4
17
147
@rustoftheday
Daily Rust
5 months
RT @AstraKernel: ✨ I love Rust's Result type: it's either an error or a value. In Go, a person can do `return nil, nil` that can mess you….
0
2
0
@rustoftheday
Daily Rust
6 months
Daily Rust reached 100 Rust tips and >2000 followers. Thank you all for your continued interest! 🚀🎉🦀.
0
0
63