Going Live on Twitch in ~10 minutes, at 12:15ish Eastern Time!
https://t.co/bMsjaK2bFS
We are going to build a BlueSky post webhook tool, to send notifications any time someone makes a post!
I think it might be time to learn #Kubernetes, so I can self host all my toy apps in one big cluster
If I want to not do a managed service (just for learning) should I do something like k3s, or the full deal? Or any non-k8s thing I should try instead?
๐ #Rustlang Tip: Use Vec::with_capacity(n) when you know the approximate size of your vector beforehand. This will reserve memory for the vector to avoid multiple allocations.
#RustCollections#Rust30by30#Day16
๐งช #Rustlang Tip: Use #[test] with #[ignore] for long-running or resource-intensive tests.
Run all tests: cargo test
Run ignored tests: cargo test -- --ignored
This helps keep your test suite fast while still allowing those long running tests when needed!
#Rust30by30#Day15
๐ #Rustlang Tip: Use cargo clippy to catch common mistakes and improve your code!
It's also a great learning tool! It will show you best practices to follow, and by reading and understanding the suggestions you can improve your skills as a Rust developer!
#Rust30by30#Day14
โก #Rustlang Tip: cargo expand - Your X-ray Vision for Macros!
cargo expand allows you to see the expanded code generated by macros, providing more insight into what's happening under the hood.
Learn more here: https://t.co/3TLjCGJLzC
#RustMacros#Rust30by30#Day13
๐จ Rust Tip: Use cargo fmt to automatically format your code!
๐ You can even setup your editor to Auto-Format on save!
VS Code Instructions:
- Install the Rust Analyzer extension
- Open settings
- Search for "Format on Save" and enable it
#RustTips#Rust30by30#Day12
Going live for a stream once I get myself all situated this morning!
We are going to be working on JustAdios, my tool to end Zoom Meetings after a set amount of time. We've got the basic working, so today working on polish!
Starting in ~20 minutes
https://t.co/bMsjaK2bFS
๐๏ธ #Rustlang Hack: Use the ..Default::default() syntax to initialize structs with some default values while customizing others.
This is also not limited to Default::default() it will work with any instance of your struct!
#Rust30by30#Day11
๐๏ธ #Rustlang Tip: Use the #[derive(Default)] attribute for struct initialization if all your fields have a Default implementation.
Be careful though, for Strings field, the default implementation will create an empty string!
#RustTricks#Rust30by30#Day10
โก #Rustlang Tip: use Option<T> for values that might be absent.
Rust doesn't have null values, but it does have Option<T>
This lets the compiler help check for those pesky "null" cases for you, and make sure you handle the Option::None case!
#RustTricks#Rust30by30#Day9
โก #Rustlang Tip: Speed up dev cycles by using cargo check instead of cargo build during development
It skips building everything but still checks your code for any compilation errors!
You can also use cargo watch to automatically run cargo check!
#RustTricks#Rust30by30#Day8
๐ก #RustLang Tip 7:
โ DO: use match for pattern matching, especially when dealing with enums.
โ DON'T: rely on if-else for enum handling, when a new variant is added nothing will remind you to update your branches!
#RustLang#30by30#Day7
New Byte just dropped! This one is a small color blending CLI, and I like the bugs that are hidden in it! Feels like a more realistic bug than some of our other ideas!
See if you can spot all three bugs hidden in this challenge!
Check it out!
https://t.co/8zCImyUZyz
#Rustlang
๐ง #Rustlang Tip
Use the #[derive(Debug, Clone)] attribute to automatically generate implementations for the Debug and Clone traits.
๐ก Clone is useful when you need a copy of the struct
๐ก Debug is useful for printing the struct for debugging, try with dbg!
#Rust30by30#Day6
Today's Stream is up on Youtube if you missed it live!
https://t.co/bG7wAPNOUB
Come along as I integrate Zoom Webhooks into our app that shuts down long meetings!