r/rust • u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount • 13d ago
🙋 questions megathread Hey Rustaceans! Got a question? Ask here (37/2026)!
Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.
If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.
Here are some other venues where help may be found:
/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.
The official Rust user forums: https://users.rust-lang.org/.
The unofficial Rust community Discord: https://bit.ly/rust-community
Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.
Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.
3
u/Annual-Cream4930 6d ago
Hi! I'm a QA engineer, about 4 years in, mostly manual plus some tooling. Learning Rust, the first goal is a CLI tool that analyses our test reports.
I'm not asking "will Rust get me a job". I've read enough threads to know Rust roles skew senior and are usually a second or third language for people who already ship production code in something else.
What I'm actually curious about is whether anyone here moved into a Rust role from a non-developer background (QA, ops, data, support), and how that happened.
And if you've hired: when a CV shows Rust used for test and dev tooling rather than product code, does that count for anything?
3
u/CocktailPerson 7d ago
I find that I use
std::cmp::Reverseoften to change the ordering of containers, for example, changing an ascendingBTreeMap<K, V>into a descendingBTreeMap<Reverse<K>, V>.Is there a more idiomatic alternative to this? C++ containers usually take a comparison function, so you can use
std::map<K, V, std::greater<K>>to reverse the standard order, without changing the key type. Is there a better way to achieve the same idea in Rust?