Skip to content

Generic parameters on Bencher are not API compatible with criterion #13

@davidhewitt

Description

@davidhewitt

In PyO3 we tend to manifest all lifetime parameters in structures, eg: https://github.com/PyO3/pyo3/blob/8dc3d2bc118bd03d206c666bf0ad1d304b737728/pyo3-benches/benches/bench_any.rs#L64

(So we write &mut Bencher<'_> instead of &mut Bencher.)

The compat mode of this crate doesn't have the lifetime parameter (or the generic parameter M: Measurement, but that's not relevant to us in PyO3).

I think for the lifetime it would be possible to solve this by changing the definition of Bencher to be

pub struct Bencher<'a> {
    codspeed: &'a mut CodSpeed,
    uri: String,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions