This is a helpful article for me, thank you for posting!
Does Lobsters allow posts like these, though? It’s a great article, but includes an ad for a service as the last section.
It’s a useful article until then so it’s worth letting the votes govern its relevance, imo.
I’d say there’s a difference between “here’s some useful Rust stuff, btw use our logging SaaS at the end” and “here’s why you should use our logging SaaS”
Author here, glad you like it.
I will add a conclusive sentence to make the distinction between the article and the advertisement clearer.
Thanks for the article, I didn’t mind the ad. Do you inspect the stack frames non-intrusively via sampling?
if it’s not too intrusive its okay, for example when you can read the article without the ad and you don’t miss big parts of the post
Personally, I don’t mind it. There’s a lot of great and interesting content out there published by companies that usually includes some sort of “ad” for their service. I don’t want to cut that out just because they say, “hey, use our stuff” at the end. Especially because I can just ignore the ad bit and still learn something.
Thanks for sharing, here! I like this approach to trying to learn Rust, because there are a handful of patterns in other languages that aren’t feasible in Rust
Glad you like it. And yes, Rust chooses some tradeoffs differently than other languages, which sometimes trips up people new to the language.
Knowing these impossible cases is quite useful — it can save you from fighting with the borrow checker a battle that you can’t win.
Well, not exactly impossible, just needs a bit of unsafe and – Oh god why are there dolphins swimming in my pretzel bath (undefined behavior)?
Also, as far as I know: If another package exposes enums, you can’t choose a random one of those without modifying the original package.
Hmm, helpful, but perhaps not as helpful as it could be.
All in all a good post though. As for initializing an array without re-initializing it, I had to give it a go and see what happened. The results were, hilariously at once more and less than I could hope.
// I solemny swear that I'm up to no good, and also single threaded.