Is there a tool for automatically transpossing my module structure?
You're right! I had created a module with a body and then only got one option for converting it to a file. But doing it with just mod foo; does give me those two options.
Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.
Latest posts
You're right! I had created a module with a body and then only got one option for converting it to a file. But doing it with just mod foo; does give me those two options.
I tried it in helix and it gave both options

Hi folks! Are you aware of any new/growing concurrency projects in the rust ecosystem which I could contribute to? Like projects that involve using atomics and stuff. Thanks!
I do it in reverse, I open foo/bar.rs then trigger the action for inserting mod bar;
Hey MD-FAHAD25624, There is some info here: https://users.rust-lang.org/t/can-rust-compile-to-c-and-c/47434 That might help you. If otherwise, later today I am going to try to find a reliable way to convert Rust to Arduino C++. It might be hard, and I might have to code a crate just to translate. I know some Arduino C++, so if I have to translate it, it should be easy, but the question for you is if you can compile Rust on your phone, and download crates. Sounds good? Respond to me with your…
If using nightly, you could wrap the function in your own struct to silence its unused status. But yes I think there should be a better way, I don't know if there is.
Looks like #[allow(unused_must_use)] on your function does not work but a file-level #![allow(unused_must_use)] does. PS. ah that's probably because then it also acts on the call site
I'm writing a library that has a function like this: /// The returned closure does not need to be called, but doing so /// amuses the computer gremlins. pub fn foo() -> Result<impl FnOnce(), Box<dyn Error>> { // ... } It is perfectly valid to ignore the returned closure, but ignoring the closure generates the must_use compiler warning, "unused implementer of FnOnce that must be used". How can I disable that must_use attribute so that users of my library don't have to sprinkle in let _ = at each…
bjorn3: rust-analyzer asks if you want to create foo.rs or foo/mod.rs. I just tried it in Helix and it did not ask. Maybe you're remembering an editor-specific feature. I was wrong, it does work with mod foo;
I own a full Arduino kit now, including Arduino UNO, stepper motor board and other things. But before that, I started learning Rust as my first serious programming language. So now I don't want to learn Arduino C++ just to use my kits, I want to use Rust for Arduino too. I heard that avr -hal for using that. But is it that much reliable? What's it's current condition? I have absolutely zero intention of learning Arduino C++. And my coding environment is fully on Termux in my phone, I don't have…
I'm pretty sure rust-analyzer asks if you want to create foo.rs or foo/mod.rs.
That's not the problem ring described, though. Imagine you are in lib.rs. type mod new; and a trigger LSP action to create a file for the module. It will create src/new.rs. You can rename the module easily with the rename action, but there isn't an in-editor way to move it to src/new/mod.rs.
Or, alternatively, both positive and negative works too!
I'd like to nominate dataviz, a plotting crate that just reached 1.0: 120+ chart types, interactive and live windows, PNG/SVG/PDF/HTML output, 3D and maps. It benchmarks faster and leaner than the other Rust plotting crates (benchmarks), and the same renderer is usable from Python, JavaScript and C/C++. Announcement: [ANN] dataviz 1.0: plotting with 120+ chart types, live windows, 3D and maps Full disclosure: I'm the author.
dataviz 1.0 is out: crates.io: Rust Package Registry It's a plotting crate with its own rasterizer (CPU, multi-core, or GPU via wgpu), 120+ chart types and interactive windows: use dataviz::prelude::*; let mut fig = Figure::new(900, 500); fig.axes().line(&x, &y).label("signal"); fig.show("demo")?; // zoom, pan, hover; or fig.save("plot.png") Highlights of the road to 1.0: grammar of graphics: Chart::new(data, Mark::Point).x("a").y("b").color("group").facet("site", 3) volume files (NIfTI, DICOM,…
I never use the semver trick, because I'm a selfish jerk. I don't make my code more convoluted by requiring other versions of the same crate as deps and doing some re-export juggling just to make life easier for the consumers. I just use a semver major bump. Take it or leave it.

On the topic of neat tricks with semver (which I would like for cargo to enforce), there is slint's way of adding new feature flags for existing functionality without breaking semver.
Oh that's cool, I think that’s a detail I hadn’t really though about before, personally. More generally, it’s not uncommon though that publication order can matter with semver, i.e. where multiple things must come “together”. Usually this pattern appears with blanket impls; i.e. introducing a new trait and/or type together with blanket impls that cover it is fine, but introducing the impls later can be breaking because downstream could already have conflicting concrete impls. The semver-trick…

The README is honestly too long to actually look through in detail. Especially if the goal is to be "beginner-friendly" (whatever that means, exactly), moving on immediately to implementation details of the compiler, and a reference-ish listing of each part of the language (which seems to be somewhat duplicated with separately documented LANGUAGE.md, as well, doesn't it?) doesn't come across as particularly "beginner-friendly". If that's down to (I assume) this is a completely unfinished…
I've been building Rcompiler, a compiler and interpreter written in Rust for my own programming language, Sema. I'm sharing it publicly and would appreciate feedback from people interested in compiler development, language design, and Rust as i have started my journey leaning it The repository includes documentation covering the language and its specifications. GitHub: GitHub - DtronicE/Rcompiler: A beginner-friendly custom programming language and interpreter, built with Rust, with a future…
Hi and welcome to the Rust users forum. It looks like you have found the option to share code from the rust Playground here. Usually, you should use this with some code have questions about or need help with. If you do so, also make sure to add a problem description or question to your post. Like this not that much for anyone to react to. I wish you the best of fun and success learning Rust. The example you've shared - just to look at it - admittedly isn't particularly interesting to us more…

Sounds like a helix problem to me. In VSCode it's trivial to rename a file: you just select it and press F2.
I think the best improvement would be to change the help in non_snake_case to tell you that this looks like a constant: Something like: warning: unused variable: `MISSING_CONST` --> src/main.rs:4:24 | 4 | matches!(bar, Some(MISSING_CONST)); // returns true, accepting any value in Some() | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_MISSING_CONST` | = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default warning: variable `MISSING_CONST`…
I had a thought about the semver trick. Made a blog post out of it. SGued The semver trick is not backwards compatible if you wait
I did get those two warnings, but those warnings are also what you get if you do the equivalent of the following: let UNUSED = true; I was trying to communicate with my post that, to only return those two warnings you listed above seems like a pitfall, because a namespacing problem has sneakily changed the meaning of a match/matches! statement. A solution could be a warning that fires in addition to the existing ones when a match binding is ALL_CAPS, which says something like "Did you mean to…
burjui: For me, the reason is I find having both foo.rs and foo directory redundant. For me the main issue is the friction of creating modules, I can create foo/bar.rs with the same action as creating a foo.rs file in helix, but moving foo.rs to foo/mod.rs requires using a file manager or another terminal with mv, both of which are annoying.
/* Your very first program in Rust :) For every lesson: play.rust-lang.org */ fn main() { let financial_management = "MCB"; // string type let credit_score = 800; // integer type has no decimal (float has decimal) let account_active = true; println!("{} manages my financial account.", financial_management); println!("Credit score: {}", credit_score); println!("Account active: {}", account_active); } (Playground)
When I compile the code you provided on the Rust Playground, I do get two warnings: warning: unused variable: `MISSING_CONST` --> src/main.rs:4:24 | 4 | matches!(bar, Some(MISSING_CONST)); // returns true, accepting any value in Some() | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_MISSING_CONST` | = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default warning: variable `MISSING_CONST` should have a snake case name --> src/main.rs:4:24 | 4 |…
I ran across this behavior when I had moved a constant outside the module and didn't get the diagnostic I was expecting. It was something like this: // const MISSING_CONST: &str = "foo"; fn main() { let bar = Some("bar"); matches!(bar, Some(MISSING_CONST)); // returns true, accepting any value in Some() } I expected the matches! to not allow an unused binding I guess, or at least warn. Constant-like bindings are similarly addressed here. I wonder if we could at least make it a different warning…
I'd like to nominate secretguard: a sub-millisecond (15.68 µs) native Rust terminal line-hook and privacy guard that prevents API keys, tokens, and database credentials from leaking into shell history (.zsh_history, .bash_history) or AI coding assistant logs (Claude Code, Cursor). Crates.io: crates.io: Rust Package Registry GitHub: GitHub - hemanathk636/secretguard: Sub-millisecond Terminal Secret & Privacy Guard for Developers and AI Agents · GitHub