These are chat archives for rust-lang/rust
HashMapshould have a function that is like
impl ToOwned<T>instead of
Tas the key. This would avoid unnecessary cloning when the key already exists in the collection. Is there such a proposal?
benches(I'm using criterion), and the use some common code, which really is specific to benchmarks and not needed somewhere else. Where can I put that code to import it into the benchmarks properly? I tried making
benches/common.rsbut there seems to be no way to
use common;or something.
benchesdirectory containing the files
card.rs. Both benchmarks run properly, but make use of a function
confthat as of now is defined identically in both files.
mod integration; mod card; etc
mod integration; mod card; mod commonin there, and put the function in
benches/common.rs. But I can' use
benchesdirectory lives on the same level as
#[cfg(test)] mod benches
mod.rsin the wrong directory, so of course it could not be found, no matter the invocation...