Skip to content

Generate docs with features for docs.rs #1303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 28, 2022

Conversation

jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Feb 12, 2022

Enable generating docs using --all-features or --features="std" where applicable. Additionally, use doc_auto_cfg to tag items requiring a feature.

https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#doc_auto_cfg-automatically-generate-doccfg

This requires building with nightly, which is what is used by docs.rs.

https://docs.rs/about/builds

To test locally, use:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc ...

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2022

Codecov Report

Merging #1303 (62b1e01) into main (7ac4c3b) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1303   +/-   ##
=======================================
  Coverage   90.51%   90.52%           
=======================================
  Files          72       72           
  Lines       39608    39608           
=======================================
+ Hits        35853    35854    +1     
+ Misses       3755     3754    -1     
Impacted Files Coverage Δ
lightning-background-processor/src/lib.rs 93.04% <ø> (ø)
lightning-block-sync/src/convert.rs 94.02% <ø> (ø)
lightning-block-sync/src/lib.rs 93.78% <ø> (ø)
lightning-invoice/src/lib.rs 88.25% <ø> (ø)
lightning-net-tokio/src/lib.rs 76.69% <ø> (ø)
lightning-persister/src/lib.rs 94.30% <ø> (ø)
lightning/src/lib.rs 100.00% <ø> (ø)
lightning/src/routing/scoring.rs 95.03% <ø> (ø)
lightning/src/util/events.rs 33.45% <ø> (ø)
lightning/src/ln/functional_tests.rs 97.05% <0.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ac4c3b...62b1e01. Read the comment docs.

@@ -985,7 +985,7 @@ impl fmt::Display for DecodeError {
DecodeError::InvalidValue => f.write_str("Nonsense bytes didn't map to the type they were interpreted as"),
DecodeError::ShortRead => f.write_str("Packet extended beyond the provided bytes"),
DecodeError::BadLengthDescriptor => f.write_str("A length descriptor in the packet didn't describe the later data correctly"),
DecodeError::Io(ref e) => e.fmt(f),
DecodeError::Io(ref e) => Debug::fmt(&e, f),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also changed in #1301, let's not conflict.

@@ -246,7 +246,6 @@ type ConfiguredTime = time::Eternity;
/// [`Score`] implementation.
///
/// (C-not exported) generally all users should use the [`Scorer`] type alias.
#[doc(hidden)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See commit message. Type alias docs don't show any methods and you can't click on the underlying type without removing this.

@TheBlueMatt
Copy link
Collaborator

Needs rebase after #1301 landed, otherwise ACK.

The docs were hidden since a type alias should be used. However, the
alias docs don't contain much useful information and don't link to the
corresponding struct.
Enable generating docs using --all-features or --features="std" where
applicable. Additionally, use doc_auto_cfg to tag items requiring a
feature.

https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#doc_auto_cfg-automatically-generate-doccfg

This requires building with nightly, which is what is used by docs.rs.

https://docs.rs/about/builds

To test locally, use:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc ...
@jkczyz jkczyz force-pushed the 2022-02-docs-with-features branch from 8653104 to 62b1e01 Compare February 18, 2022 21:40
@jkczyz jkczyz added this to the 0.0.105 milestone Feb 23, 2022
@TheBlueMatt TheBlueMatt merged commit 5208f0c into lightningdevkit:main Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants