garde icon indicating copy to clipboard operation
garde copied to clipboard

No_std support

Open skibon02 opened this issue 1 year ago • 2 comments

This library would be nice to see in no std environment, especially considering the global trend for moving rust libraries to no_std (bincode, smallvec, thiserror).

I managed to make this library work on bare metal, but i did it very quickly without considering all possible use cases, please see commit https://github.com/skibon02/garde-nostd/commit/6bf09e4da2242b6f73ced3e253ccebbc127e6cd3.

Some notes about this fork version:

  1. removed support HashSet and HashMap
  2. tests still require std support
  3. removed "std" feature from regex

As for further steps, we should introduce enabled by default feature "std" and feature-gate all std-specific functionality under this feature (which only covers HashSet and HashMap, and maybe some of other library features)

I can open PR and complete all the necessary changes for this library to work on both no_std and std

skibon02 avatar Dec 05 '24 15:12 skibon02

smallvec is currently in alpha, but I don't think there'll be much breaking changes until 2.0.0 release

skibon02 avatar Dec 05 '24 15:12 skibon02

Please note that I don't have much time to work on this library or review PRs right now. The changes seems reasonable. It would also be nice to have a fully zero-alloc mode (related to https://github.com/jprochazk/garde/issues/1), but that's out of scope for now.

jprochazk avatar Dec 06 '24 10:12 jprochazk