Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notable changes:
#[cfg(test)] mod test {}
, so that tests can useextern crate std;
while building the library itself withno_std
. Required to useinsta
within the test modules. (Disabling whitespace changes in the diff view makes this easier to read!) This is also why the snapshot tests were renamed: they need to include the newtest
module in the path.udiff
'sto_writer
implementations were wrapped in#[cfg(feature = "std")]
, given their reliance onstd::io
.The
cargo test --no-default-features
should handle testing theno_std
paths in CI already.Things I'm not sure about:
no_std
land. Right now, it defines*_deadline
functions should be omitted entirely when compiling without a time provider? This is a more involved change, which is why I did not do it in this PR. Other suggestions welcome.hashbrown
was added as a dependency becausealloc::collections
only containsBTreeMap
. Rust'sstd::collections::HashMap
requires a random source. With my changes:std
, so it will always show up in the dependency list, regardless of if it's used. Alternatively, we could useBTreeMap
for these instead? But that'd require a breaking API change. (RequiringIdx::Output: PartialOrd
rather thanHash
.) Again, suggestions appreciated.