Skip to content

rethink the purpose of the smallvec! / smallvec_inline! macros #432

Description

@alejandro-vaz

these macros are essentially wrappers around the associated functions SmallVec::from and SmallVec::from_buf.

rust policy with macros, as written on the rust book, is simple: don't make a macro out of which can be made as a function

thus they seem very redundant

their origins trace to Vec API parity and a hack that had to be placed in 2021 in order to please the CTFE

conceptually:

smallvec![1u8, 2, 3] == SmallVec::from([1u8, 2, 3]);

smallvec_inline![1u8, 2, 3] == SmallVec::from_buf([1u8, 2, 3]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions