nvzqz / divan

Fast and simple benchmarking for Rust projects
https://nikolaivazquez.com/blog/divan/
Apache License 2.0
849 stars 24 forks source link

Is there a way to avoid `Arg<T>` #59

Open andrewgazelka opened 5 days ago

andrewgazelka commented 5 days ago

It is super annoying for auto completions to suggest divan get for literally everything.

/// Used by `#[divan::bench(args = ...)]` to enable polymorphism.
pub trait Arg<T> {
    fn get(self) -> T;
}

impl<T> Arg<T> for T {
    #[inline]
    fn get(self) -> T {
        self
    }
}