From 03a2dae05dd1ef2201eab3008015c21182ba9baa Mon Sep 17 00:00:00 2001 From: Georges Palauqui Date: Sun, 20 Oct 2024 09:22:22 +0200 Subject: [PATCH] derive_codec_sv2: refactor to std logic --- .../v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml | 3 +++ .../v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml index c7884c73a..729cc2657 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml +++ b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml @@ -16,6 +16,9 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] binary_codec_sv2 = {version = "^1.0.0", path="../codec"} +[features] +std = [] + [lib] proc-macro = true diff --git a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs index aef883ba1..dc8167ec9 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs +++ b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs @@ -1,4 +1,13 @@ +#![cfg_attr(not(feature = "std"), no_std)] + extern crate proc_macro; +#[macro_use] +extern crate alloc; + +use alloc::{ + string::{String, ToString}, + vec::Vec, +}; use core::iter::FromIterator; use proc_macro::{Group, TokenStream, TokenTree};