Bring the whole workspace into compliance with the repo's rustfmt config (edition 2024, max_width 100, use_small_heuristics = "Max"), which had drifted across many crates. Pure formatting — no logic changes; `cargo fmt --check` is now clean and `cargo build --workspace` is green.
15 lines
487 B
Rust
15 lines
487 B
Rust
#[path = "../src/convert.rs"]
|
|
mod convert;
|
|
|
|
use convert::identifier_values;
|
|
use std::{hint::black_box, time::Instant};
|
|
fn main() {
|
|
let pairs = (0..100).map(|i| (format!("x{i}"), i as f64)).collect::<Vec<_>>();
|
|
let started = Instant::now();
|
|
let mut values = 0;
|
|
for _ in 0..100_000 {
|
|
values += black_box(identifier_values(pairs.clone().into_iter().collect()).unwrap()).len();
|
|
}
|
|
println!("converted {values} Python-map values in {:?}", started.elapsed());
|
|
}
|