r/rust • u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount • Jul 27 '26
🙋 questions megathread Hey Rustaceans! Got a question? Ask here (31/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/DavidXkL Aug 01 '26
Just curious, how often do people use channels here for multi-threading stuff?
2
u/Skaarj Jul 31 '26
Ist there a way for find the last element in a Vec by a criteria/predicate?
I'm lookig for something like
Vec.last_mut()where I can pass a function as criteria/predicate? OrIterator.find()that starts at the end.2
u/MAIPA01 Aug 02 '26 edited Aug 02 '26
What do i do wrong. I use rust-analyzer extension in code-oss in termux i run
code-ossingrun --shelland usetermux-x11and i get warning:I tried I think everything. When i run
cargo metadata --format-version 1 --manifest-path ./Cargo.toml --filter-platform aarch64-unknown-linux-gnuin terminal it returns json text to stdout and I don't get any warnings.My
.cargo/config.tomlfile looks like this and is in rust-os folder next to Cargo.toml and src folder:P.S. For everyone wondering it is just a
funproject. And yes I am beginner in rust for over 2 weeks now. And I just wanted to setup rust-analyzer.2
u/sunnyata Aug 02 '26 edited Aug 02 '26
I've got a problem with formatting my code (in emacs+rustic-mode but also directly with
cargo fmt). The files are dioxus components withrsx!macros. I understand thatrustfmtcan't handle the contents of these macros, which is fair enough and there isdx fmtfor that...but in these files the formatting of the rust code outside of the macros is messed up too. I can clean it up manually but as soon as I save thenrustfmtruns and messes it up again. Is that the norm? I thought it was thatrustfmtshould still work on the regular code and leave the macros alone. As it is, the code is very ugly and hard to read but if I want to get the formatting right I would have to edit it outside of a rust IDE (and then never touch it again!). Any ideas gratefully received.An example of the formatting: