Conversation
sbihel
approved these changes
Jan 11, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As mentioned in #360 (comment)
The
doc_cfganddoc_auto_cfgfeatures are described in rust-lang/rust#90502 and enable rustdocs to render uses of#[cfg(feature = ...]). These features are enabled using a cfg attributedocsrswhich is enabled in Cargo.toml for docs.rs. Sincedoc_cfganddoc_auto_cfgare unstable features, thisdocsrsattribute is left disabled by default. It can also be enabled on the command-line as in the following command to build the docs using a nightly toolchain (Runrustup update nightlyfirst if you haven't installed nightly recently):RUSTDOCFLAGS='--cfg docsrs' cargo +nightly doc --no-deps --features secp256r1,secp256k1,ripemd-160,http-didAfter building docs with that command, open

target/doc/ssi/hash/fn.sha256.html:Features secp256r1,secp256k1,ripemd-160,http-did are set as enabled by default for the docs.rs build (from 883f3c4 in #311).
I combined the two sha256 function implementations into one function, as I wasn't otherwise able to get the docs to list its supported crate features as "sha2 or ring". (Similar: rust-lang/rust#90497 (comment))