tikv / rust-prometheus

Prometheus instrumentation library for Rust applications
Apache License 2.0
1.04k stars 182 forks source link

Enhance: replace `unwrap()` with `Result` to handle errors in `register-*` macros #480

Open eval-exec opened 1 year ago

eval-exec commented 1 year ago

This PR modifies the register_* macro to use the and_then method instead of unwrap to handle errors.

The purpose of this change is to improve error handling and make the code more robust.

eval-exec commented 1 year ago

https://github.com/tikv/rust-prometheus/actions/runs/4349482473/jobs/7603874911

The CI action failed, I think we should upgrade the rust toolchain's version.