From 3d41993fefa9b84c6042b6115e7f03157a4e935b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sun, 30 Jul 2023 22:28:43 +0200 Subject: [PATCH] fix: support features --- .github/workflows/ci.yml | 3 +-- CHANGELOG.md | 6 ++++++ Cargo.toml | 6 +++--- src/support/scale.rs | 1 + src/support/serde.rs | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3712373..d0d9a00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,8 +62,7 @@ jobs: run: | cargo hack check \ --feature-powerset --exclude-features nightly,generic_const_exprs \ - --depth 1 \ - --all-targets + --depth 1 codecov: # See diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cd689b..34f1370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed some support features ([#289]) + +[#289]: https://github.com/recmo/uint/pulls/289 + ## [1.10.0] - 2023-07-30 ### Added diff --git a/Cargo.toml b/Cargo.toml index 8cd1050..53c17b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,12 +123,12 @@ fastrlp = ["dep:fastrlp", "alloc"] num-bigint = ["dep:num-bigint", "alloc"] parity-scale-codec = ["dep:parity-scale-codec", "alloc"] primitive-types = ["dep:primitive-types"] -proptest = ["dep:proptest", "alloc"] +proptest = ["dep:proptest", "std"] # TODO: change to "alloc" on the next proptest release (>1.2.0) pyo3 = ["dep:pyo3", "std"] quickcheck = ["dep:quickcheck", "std"] rand = ["dep:rand"] -rlp = ["dep:rlp"] -serde = ["dep:serde"] +rlp = ["dep:rlp", "alloc"] +serde = ["dep:serde", "alloc"] # TODO: try to avoid alloc in serde impls valuable = ["dep:valuable"] zeroize = ["dep:zeroize"] diff --git a/src/support/scale.rs b/src/support/scale.rs index 3ba9bab..d23005a 100644 --- a/src/support/scale.rs +++ b/src/support/scale.rs @@ -4,6 +4,7 @@ #![cfg_attr(docsrs, doc(cfg(feature = "parity-scale-codec")))] use crate::Uint; +use alloc::vec::Vec; use parity_scale_codec::{ Compact, CompactAs, Decode, Encode, EncodeAsRef, EncodeLike, Error, HasCompact, Input, MaxEncodedLen, Output, diff --git a/src/support/serde.rs b/src/support/serde.rs index a278c46..1641e8f 100644 --- a/src/support/serde.rs +++ b/src/support/serde.rs @@ -4,6 +4,7 @@ #![cfg_attr(docsrs, doc(cfg(feature = "serde")))] use crate::{nbytes, Bits, Uint}; +use alloc::string::String; use core::{ fmt::{Formatter, Result as FmtResult, Write}, str, @@ -174,6 +175,7 @@ impl<'de, const BITS: usize, const LIMBS: usize> Visitor<'de> for ByteVisitor