I've not used Rust much and I'm getting stuck a bit using the type Box<[u32;1024]>, I can't figure out how I'm supposed to directly allocate and zero initialise this without copying it from the stack or using a vector or something which feels wrong.…
I think this is a Clippy error, because everything works as expected, but I can't stop guessing if there is a subtle error in my code: pub async fn run(mut self) { tracing::info!("Redis host task started"); 'exit: loop { let mut evt_connection =…
I'm trying to write a case-insensitive string type, and I'm having problems with match arms. It seems that match doesn't use PartialEq under the hood, but I couldn't find out if there's another trait that it uses. (Most results for "match" + "trait"…
The program I'm working on is going to end up with a set of read-only files containing collections of structure data. My original thought was to have the data split up into reasonably sized sets across a number of files, and load an entire file into…
Hello, I'm new to rust, so I don't understand some things. If you have time to explain the fix and help me to do it: thank you! #[allow(unused_imports)] use owo_colors::OwoColorize; mod display; macro_rules! error { ($($e:tt)*) => { eprintln!("{}:…
hi guys, actually I was considering which field would be better to start learning and work with, actually I know the core of Rust and basic concepts of Rust, but I was wondering about which field to start with... I would appreciate your experiences…
Hi there, I just heard about programming on the internet and bit curious about it. I have no idea about it then I google it and ask with which language I should start with then google say "Python". But i am bit more curious about Rust, should i…
Hello, I am not sure if I'm doing something wrong or this is a bug to be reported, but this is the situation: The following code on its own (as expected) does not compile: trait Trait { const N: usize; fn foo() -> [u8; Self::N]; } The error message…
We're a small co-op building Spare Kit, an open-source (MPL-2.0) geometry kernel in Rust, to power a Revit/CAD alternative that runs natively and in the browser (WASM). Much of the code is written by AI agents working through a mapped plan, with…
Hi, the short story is that I want to make a inventory web page in rust and I want to ask you ¿what would be your preferred/recommended crates? I do believe though that a longer explanation can be useful with the recommendations so here are some…
This is more of a matter with how to get deploying your web backends/services than anything else. Sure, the easiest path would be to rent or pay for a server to deploy backend into. But as much as possible I'd look for a free alternative first then…
I'm sorry if the title is unclear - I couldn't figure a better one. Also my apologies for my English or if my terminology isn't exact, I'm not a native speaker (open to any feedback.) TL;DR: Here's reproducible example in the playground.. The…
RFC 3678: Why should final rule out downstream use cases that library authors never anticipated? I'd like to raise a concern about RFC 3678 — Final Trait Methods. My concern is simple: Why should a library author's inability to anticipate a future…
struct Shape { id: u32, color: Color, kind: ShapeKind } enum ShapeKind { Circle { r: f64 }, Rect { w: f64, h: f64 } } match shape.kind { ShapeKind::Circle {..} ... } Brother, it makes you write a lot of lines to reach one thing, and this is what I…