alloy-rs / alloy-rs/core

[Feature] Move alloc feature behind a feature gate

Ouverte
#999 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement good first issue
Langage dominant
Rust
Étoiles
966
Forks
274
Merge moyen
1 j 21 h
PR mergées (30 j)
15

Description

### 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_

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.