The primitives library defines the fixed_bytes_macros! {} internal utility macro, which in turn is used to define exported macros such as address!() for compile-time values. The latter takes in a hex-encoded string literal, which is then represented as an Address value.
Currently the hex-literal crate is responsible for translating hex-encoded string literals into byte arrays in compile time. It is not feature-complete though, notably it lacks the support for "0x" prefix.
There exists an alternative hexlit crate which seems to be a more recent drop-in replacement for hex-literal, and which does support additional features such as "0x" prefix, as well as some extra kinds of formatting characters, such as hyphen '-' and underscore '_'.
Component
primitives
Describe the feature you would like
The
primitives
library defines thefixed_bytes_macros! {}
internal utility macro, which in turn is used to define exported macros such asaddress!()
for compile-time values. The latter takes in a hex-encoded string literal, which is then represented as anAddress
value.Currently the
hex-literal
crate is responsible for translating hex-encoded string literals into byte arrays in compile time. It is not feature-complete though, notably it lacks the support for"0x"
prefix.There exists an alternative
hexlit
crate which seems to be a more recent drop-in replacement forhex-literal
, and which does support additional features such as"0x"
prefix, as well as some extra kinds of formatting characters, such as hyphen'-'
and underscore'_'
.Additional context
No response