Hello, I'm trying to use the rust-dev component where I use rustc_hash, and when I do cargo build I get the following error: error[E0464]: multiple candidates for `rmeta` dependency `rustc_hash` found --> src/main.rs:11:1 | 11 | extern crate…
Apparently I've been playing a game with myself to see how many times I can answer my own questions in the process of figuring how to phrase them correctly enough to be understandable. Regardless, I still haven't found a firm 'does this exist' in my…
AI Assistance Disclosure: AI assistance was used to help draft and proofread the English text, as I'm not a native English speaker. 1. Summary I'd like to explore an extension to Rust enums that would let us declare common, typed properties directly…
I was looking for a way of an application scheduler prioritizing async functions based on some application state inside pending futures. (This is currently a toy project, not really a production system.) I was curious if it's possible to expose…
For Reasons™️, I use nightly rustfmt for all my crates. I configured my vim to pass +nightly when formatting on save, which works fine. However, when others are working on the code I sometimes forget to tell them to switch to nightly rustfmt, which…
Back in 2020, I proposed a #[sensitive] attribute for functions which handle transient secrets. I'm also the author of the zeroize crate. I'd like to revisit that proposal, particularly as we continue to struggle with what to do for stack…
Okay, so I published this crate called closed about a week ago. It's basically std::function for Rust if anyone's curious. I haven't done any marketing at all — no Reddit, no Twitter, zero. Just pushed 8 versions fixing stuff up. Right now it's…
I have an application that passes around a lot of Arc<dyn Whatever>, and many of the traits have do-nothing or default implementations on a zero-sized type that can be used in a lot of cases. Unfortunately, Arc<T>::new allocates heap memory even…
fn main() { println!("Hello, world!"); } Hello my fellow rustaceans! This is my first rust code, I needed to format this code automatically, when I run the cargo fmt it does not work or format it. Any help plz. 8 posts - 4 participants Read full…
Hello everyone I’m using gray_matter to retrieve data from a Markdown file; the idea is to create my own static page, but I’m getting this error. [lark@lark blog]$ cargo run Compiling blog v0.1.0 (/home/lark/Documents/programming/rust/blog) Finished…
When using anyhow in my Rust code should I make the return type anyhow::Result everywhere or when a function returns only one type of result (for example io::Result) should I return that instead? 3 posts - 3 participants Read full topic
I am using softbuffer, which doesn't specify the color space used (except for the fact that it uses 8 bits per channel), I'm writing a pixel art editor and intend to use OKLab internally, so I need to have a rough idea of the color space to convert…
This is part code problem and part architecting Tokio.. or so I think. I have 46 devices I connect to via russh. I then put them into a future as shown below. The russh connections does a netconf get_config followed by a get state. Is russh the…
This compiles: pub trait MyTrait { fn do_it(&self) -> &i32; } impl AsRef<i32> for dyn MyTrait { fn as_ref(&self) -> &i32 { self.do_it() } } It compiles even though AsRef is foreign, because the orphan rules consider dyn T to be local if T is local,…