From 005e478b0c9e080a7c374b3c9e0498caeda28efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=88=CE=BB=CE=BB=CE=B5=CE=BD=20=CE=95=CE=BC=CE=AF=CE=BB?= =?UTF-8?q?=CE=B9=CE=B1=20=CE=86=CE=BD=CE=BD=CE=B1=20Zscheile?= Date: Wed, 18 Feb 2026 20:46:47 +0100 Subject: [PATCH 1/2] feat(errors): Use Error trait from core crate --- src/errors.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index a37323c..9c33b07 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,8 +1,9 @@ -use core::fmt::{self, Display, Formatter}; #[cfg(any(feature = "byte", feature = "bit"))] pub use core::num::TryFromIntError; -#[cfg(feature = "std")] -use std::error::Error; +use core::{ + error::Error, + fmt::{self, Display, Formatter}, +}; #[cfg(any(feature = "byte", feature = "bit"))] use rust_decimal::Decimal; @@ -21,7 +22,6 @@ impl Display for ExceededBoundsError { } #[cfg(any(feature = "byte", feature = "bit"))] -#[cfg(feature = "std")] impl Error for ExceededBoundsError {} #[cfg(any(feature = "byte", feature = "bit"))] @@ -50,7 +50,6 @@ impl Display for ValueParseError { } #[cfg(any(feature = "byte", feature = "bit"))] -#[cfg(feature = "std")] impl Error for ValueParseError {} /// The error type returned when parsing units. @@ -111,7 +110,6 @@ impl Display for UnitParseError { } } -#[cfg(feature = "std")] impl Error for UnitParseError {} #[cfg(any(feature = "byte", feature = "bit"))] @@ -150,5 +148,4 @@ impl Display for ParseError { } #[cfg(any(feature = "byte", feature = "bit"))] -#[cfg(feature = "std")] impl Error for ParseError {} From cce6cd324c20fa43a11c816493ee86019c35d2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=88=CE=BB=CE=BB=CE=B5=CE=BD=20=CE=95=CE=BC=CE=AF=CE=BB?= =?UTF-8?q?=CE=B9=CE=B1=20=CE=86=CE=BD=CE=BD=CE=B1=20Zscheile?= Date: Wed, 18 Feb 2026 20:47:05 +0100 Subject: [PATCH 2/2] chore: use core::str::FromStr everywhere --- src/bit/adjusted/rocket_traits.rs | 2 +- src/bit/rocket_traits.rs | 2 +- src/byte/adjusted/rocket_traits.rs | 2 +- src/byte/rocket_traits.rs | 2 +- src/unit/rocket_traits.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bit/adjusted/rocket_traits.rs b/src/bit/adjusted/rocket_traits.rs index f946092..d72385e 100644 --- a/src/bit/adjusted/rocket_traits.rs +++ b/src/bit/adjusted/rocket_traits.rs @@ -1,4 +1,4 @@ -use std::str::FromStr; +use core::str::FromStr; use rocket::{ form::{self, FromFormField, ValueField}, diff --git a/src/bit/rocket_traits.rs b/src/bit/rocket_traits.rs index d118d35..ebe676a 100644 --- a/src/bit/rocket_traits.rs +++ b/src/bit/rocket_traits.rs @@ -1,4 +1,4 @@ -use std::str::FromStr; +use core::str::FromStr; use rocket::{ form::{self, FromFormField, ValueField}, diff --git a/src/byte/adjusted/rocket_traits.rs b/src/byte/adjusted/rocket_traits.rs index 6d14d3f..fe4def6 100644 --- a/src/byte/adjusted/rocket_traits.rs +++ b/src/byte/adjusted/rocket_traits.rs @@ -1,4 +1,4 @@ -use std::str::FromStr; +use core::str::FromStr; use rocket::{ form::{self, FromFormField, ValueField}, diff --git a/src/byte/rocket_traits.rs b/src/byte/rocket_traits.rs index 5f3c265..bfe83f1 100644 --- a/src/byte/rocket_traits.rs +++ b/src/byte/rocket_traits.rs @@ -1,4 +1,4 @@ -use std::str::FromStr; +use core::str::FromStr; use rocket::{ form::{self, FromFormField, ValueField}, diff --git a/src/unit/rocket_traits.rs b/src/unit/rocket_traits.rs index be2bbc9..0677e97 100644 --- a/src/unit/rocket_traits.rs +++ b/src/unit/rocket_traits.rs @@ -1,4 +1,4 @@ -use std::str::FromStr; +use core::str::FromStr; use rocket::{ form::{self, FromFormField, ValueField},