From 11e7e81d23ff8a2ea87805f3048bc30f4ef0dcbf Mon Sep 17 00:00:00 2001 From: Georges Palauqui Date: Wed, 20 Nov 2024 18:02:56 +0100 Subject: [PATCH] use rustversion to avoid an extra feature --- Cargo.toml | 1 + stratum-v1/Cargo.toml | 2 +- stratum-v1/src/error.rs | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f6dcfd6..4cf5e79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,7 @@ minicbor = { version = "0.24", features = ["derive"] } nom = { version = "7", default-features = false } phf = { version = "0.11", features = ["macros"], default-features = false } rand_xoshiro = "0.6" +rustversion = "1.0" secp256k1 = { version = "0.29", default-features = false } serde = { version = "1.0.156", features = ["derive"], default-features = false } serde_json = "1" diff --git a/stratum-v1/Cargo.toml b/stratum-v1/Cargo.toml index 356a837..9aeb698 100644 --- a/stratum-v1/Cargo.toml +++ b/stratum-v1/Cargo.toml @@ -20,11 +20,11 @@ embedded-io-async = { workspace = true } faster-hex = { version = "0.10", default-features = false } heapless = { workspace = true, features = ["serde"] } log = { workspace = true, optional = true } +rustversion = { workspace = true } serde = { workspace = true } serde-json-core = { workspace = true, features = ["custom-error-messages"] } [features] -core-error = [] # bump MSRV to 1.81.0 defmt-03 = [ "dep:defmt", "embedded-io-async/defmt-03", diff --git a/stratum-v1/src/error.rs b/stratum-v1/src/error.rs index 96ea516..5c1d1a1 100644 --- a/stratum-v1/src/error.rs +++ b/stratum-v1/src/error.rs @@ -73,10 +73,10 @@ pub enum Error { HexError(faster_hex::Error), } -#[cfg(feature = "core-error")] +#[rustversion::since(1.81)] impl core::error::Error for Error {} -#[cfg(feature = "core-error")] +#[rustversion::since(1.81)] impl core::fmt::Display for Error { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{self:?}")