rustls / rustls-platform-verifier

A certificate verification library for rustls that uses the operating system's verifier
Apache License 2.0
66 stars 20 forks source link

Fix incorrect platform-specific Verifier documentation #57

Closed complexspaces closed 9 months ago

complexspaces commented 9 months ago

This PR fixes the incorrect documentation on docs.rs pointed out in #56. The root cause of the problem was that when I originally wrote the Android documentation parts, I used the doc_auto_cfg feature instead of the doc_cfg by mistake. The former is too eager and assumes that anything with a #[cfg()] gate is only available under the gated conditions.

Instead of trying to get what we want with doc_auto_cfg, and especially since we only have one item that needs special documentation treatment, I've instead switched to use doc_cfg "manually". This approach was partially inspired by how Tokio generates their platform-specific documentation.

Documentation generated from a Windows system: image

Documentation generated on a macOS system:

image

Finally, I fixed a broken doc warning in the README when referencing the new_with_extra_roots function. Since this function only exists on Linux right now, documentation built on Windows and macOS won't make that symbol available. I've chosen to link to docs.rs instead for that function at least until the other platforms gain that function too.

Closes #56