statrs-dev / statrs

Statistical computation library for Rust
https://docs.rs/statrs/latest/statrs/
MIT License
603 stars 84 forks source link

Docs: add `#[doc(cfg(feature = "...'))` to feature-gated structs and trait impls #293

Closed FreezyLemon closed 2 months ago

FreezyLemon commented 2 months ago

This will add a note "Available on crate feature <...> only." to feature-gated structs, impls etc.

One random example of another crate that uses this is tokio. If you want to try it locally, you can run

cargo +nightly rustdoc --open -- --cfg docsrs

and it should show that some distributions need nalgebra, and that the trait implementations for rand::Distribution need the rand feature.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.94%. Comparing base (c866d42) to head (656f1c7). Report is 13 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #293 +/- ## ======================================= Coverage 93.94% 93.94% ======================================= Files 52 52 Lines 11783 11783 ======================================= Hits 11070 11070 Misses 713 713 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

YeungOnion commented 2 months ago

Thanks for this, was wondering if there was a way to not manually include it as a note in the docstring.