Skip to content

Conversation

@fralalonde
Copy link

I'm using utf16string for USB descriptor parsing in an embedded context, where use of std is usually not possible.

This change introduces two build features:

  • std (enabled by default)
  • alloc

Using the crate in plain no_std is thus now possible with default-features = false. The alloc feature enables some features like WString in when the no_std environment defines an allocator

Since std is marked as a default feature, this change should be completely transparent to existing users of the crate. All tests confirmed passing.

Summary of code changes:

  • references to std::* replaced by their core::* version where possible
  • references to std::* with no core::* equivalent gated by std feature (mainly std::error::Error)
  • code requiring allocation gated by std or alloc features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant