Skip to content

Support for no-alloc environments #140

@TechnoPorg

Description

@TechnoPorg

bytesize currently assumes that the alloc crate will be available, with no feature flags to toggle it on or off:

bytesize/src/lib.rs

Lines 46 to 48 in 0121741

extern crate alloc;
use alloc::string::ToString as _;

However, I'd like to use this in an embedded environment, where alloc is genuinely not available, and I don't need the formatting capabilities it would offer. It would be nice if you could gate that behind an "alloc" feature flag, which would then be pulled in by the std feature flag. Thanks!

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