alloy-rs/core

[Feature] Move alloc feature behind a feature gate

オープン

#999 opened on 2025/08/29

 (6 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (257 件のフォーク)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (952 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Component

primitives

Describe the feature you would like

I've checked the codebase, and two types that are used from the alloc crate are String and vec.

There is a possibility to move remove the alloc dependency from the crate. The only type that will be disabled by that is Bytes - but all Uxxx and Ixxx math, Address type and others will remain.

There is a bunch of formatting that use String here and there, but it all can be replaced with on-stack buffers (stack-based arrayvec::ArrayString can be used instead), because for all those cases we either know the exact buffer size of at least the maximum possible string size.

I think is reasonable to assume that primitive_types can work without the alloc, hence this issue. I can work on an implementation if this is something you consider to be accepted.

Additional context

No response

コントリビューターガイド