metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.06k stars 145 forks source link

Relax bounds on some `metrics_util::registry::Registry` methods #484

Closed david-perez closed 2 months ago

david-perez commented 2 months ago

I was thinking through https://github.com/metrics-rs/metrics/discussions/481 when I noticed this possible bounds relaxation.


The Registry struct definition requires K: Hashable, which is superfluous since it's already required in the impl block.

Moreover, some methods don't require the full K: Clone + Eq + Hashable bounds. Some methods only require K: Eq + Hashable, others only require K: Hashable, while others don't require any bounds at all on K.

This commit splits the single impl block into three impl blocks, so users that have keys that don't satisfy all bounds can still make use of some methods.

tobz commented 1 month ago

Released in metrics-util@v0.17.0.

Thanks again for your contribution. 🙏🏻