From 3d50db1387112600d70a483e45f36a47c4c7846b Mon Sep 17 00:00:00 2001 From: RA <70325462+RAprogramm@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:48:28 +0700 Subject: [PATCH] Fix benchmark black_box usage --- CHANGELOG.md | 6 ++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 ++-- benches/error_paths.rs | 7 +++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c382531..bdf5f4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [0.24.5] - 2025-10-21 + +### Fixed +- Replaced deprecated `criterion::black_box` usage in the error path benchmarks + with `std::hint::black_box` so benches compile cleanly under `-D warnings`. + ## [0.24.4] - 2025-10-20 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index bfe689a..caabbbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1806,7 +1806,7 @@ dependencies = [ [[package]] name = "masterror" -version = "0.24.4" +version = "0.24.5" dependencies = [ "actix-web", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 4e39a76..9ebc1dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "masterror" -version = "0.24.4" +version = "0.24.5" rust-version = "1.90" edition = "2024" license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index b73e739..e5c5538 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,9 @@ The build script keeps the full feature snippet below in sync with ~~~toml [dependencies] -masterror = { version = "0.24.4", default-features = false } +masterror = { version = "0.24.5", default-features = false } # or with features: -# masterror = { version = "0.24.4", features = [ +# masterror = { version = "0.24.5", features = [ # "std", "axum", "actix", "openapi", # "serde_json", "tracing", "metrics", "backtrace", # "sqlx", "sqlx-migrate", "reqwest", "redis", diff --git a/benches/error_paths.rs b/benches/error_paths.rs index be8e1e4..9723f9b 100644 --- a/benches/error_paths.rs +++ b/benches/error_paths.rs @@ -2,9 +2,12 @@ use core::{ net::{IpAddr, Ipv4Addr}, time::Duration }; -use std::fmt::{Display, Formatter, Result as FmtResult}; +use std::{ + fmt::{Display, Formatter, Result as FmtResult}, + hint::black_box +}; -use criterion::{BatchSize, Criterion, black_box, criterion_group, criterion_main}; +use criterion::{BatchSize, Criterion, criterion_group, criterion_main}; use masterror::{AppError, AppErrorKind, Context, FieldRedaction, ProblemJson, ResultExt, field}; #[derive(Debug)]