Skip to content

Conversation

@alilleybrinker
Copy link
Member

This addresses part of #20.

As part of #20, we'd like to make `std` into an optional
dependency for the `gitoid` crate, so it can be used in `no_std`
environments. This requires both transitioning usage of dependencies
to `no_std`, and moving our own imports away from `std`.

As a first step, this commit transitions just the imports which
are direct re-exports of things from `core`, to use the original
`core` imports instead. We're not ready for `no_std` yet, but this
does move us closer.

Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
Per #20, we want to make `gitoid` `no_std`-compatible. Three of
our deps: `hex`, `sha1`, and `sha2` are `no_std`-compatible. Of
those, only `sha2` appears to be able to transition to turn off
`std` immediately without impact to the APIs we use. For `hex`
and `sha1`, we'll need to update our usage of the APIs to avoid
the things that are turned off when the import becomes `no_std`.

This commit doesn't undertake the work of actually transitioning
the usage, but _does_ update the `Cargo.toml` file to:

- Transition `sha2` to `no_std` immediately.
- Update our import of `hex` and `sha1` to turn off default
  features and then purposefully activate the `std` feature. This
  makes the status of using `std` more clear, and paves for way
  for removing the manual activation in the future when we've
  updated our usage of those deps.

Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
@alilleybrinker alilleybrinker added type: feature New feature or request crate: gitoid Relating to the gitoid crate labels Dec 15, 2023
@alilleybrinker alilleybrinker enabled auto-merge (squash) December 28, 2023 21:16
@alilleybrinker alilleybrinker merged commit 8d790c7 into main Dec 28, 2023
@alilleybrinker alilleybrinker deleted the abrinker/optional_std_phase_1 branch December 28, 2023 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate: gitoid Relating to the gitoid crate type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants