Skip to content

Commit 5208f0c

Browse files
authored
Merge pull request #1303 from jkczyz/2022-02-docs-with-features
Generate docs with features for docs.rs
2 parents 219a454 + 62b1e01 commit 5208f0c

File tree

15 files changed

+38
-4
lines changed

15 files changed

+38
-4
lines changed

lightning-background-processor/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Utilities to perform required background tasks for Rust Lightning.
99
"""
1010
edition = "2018"
1111

12+
[package.metadata.docs.rs]
13+
all-features = true
14+
rustdoc-args = ["--cfg", "docsrs"]
15+
1216
[dependencies]
1317
bitcoin = "0.27"
1418
lightning = { version = "0.0.104", path = "../lightning", features = ["std"] }

lightning-background-processor/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#![deny(missing_docs)]
77
#![deny(unsafe_code)]
88

9+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
10+
911
#[macro_use] extern crate lightning;
1012

1113
use lightning::chain;

lightning-block-sync/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Utilities to fetch the chain data from a block source and feed them into Rust Li
99
"""
1010
edition = "2018"
1111

12+
[package.metadata.docs.rs]
13+
all-features = true
14+
rustdoc-args = ["--cfg", "docsrs"]
15+
1216
[features]
1317
rest-client = [ "serde", "serde_json", "chunked_transfer" ]
1418
rpc-client = [ "serde", "serde_json", "chunked_transfer" ]

lightning-block-sync/src/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl TryInto<Txid> for JsonResponse {
182182
}
183183

184184
/// Converts a JSON value into a transaction. WATCH OUT! this cannot be used for zero-input transactions
185-
/// (e.g. createrawtransaction). See https://github.com/rust-bitcoin/rust-bitcoincore-rpc/issues/197
185+
/// (e.g. createrawtransaction). See <https://github.com/rust-bitcoin/rust-bitcoincore-rpc/issues/197>
186186
impl TryInto<Transaction> for JsonResponse {
187187
type Error = std::io::Error;
188188
fn try_into(self) -> std::io::Result<Transaction> {

lightning-block-sync/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#![deny(missing_docs)]
1818
#![deny(unsafe_code)]
1919

20+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
21+
2022
#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
2123
pub mod http;
2224

lightning-invoice/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ license = "MIT OR Apache-2.0"
88
keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
99
readme = "README.md"
1010

11+
[package.metadata.docs.rs]
12+
all-features = true
13+
rustdoc-args = ["--cfg", "docsrs"]
14+
1115
[features]
1216
default = ["std"]
1317
no-std = ["hashbrown", "lightning/no-std", "core2/alloc"]

lightning-invoice/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#![deny(unused_mut)]
66
#![deny(broken_intra_doc_links)]
77

8+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
9+
810
#![cfg_attr(feature = "strict", deny(warnings))]
911
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
1012

lightning-net-tokio/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2
1010
"""
1111
edition = "2018"
1212

13+
[package.metadata.docs.rs]
14+
all-features = true
15+
rustdoc-args = ["--cfg", "docsrs"]
16+
1317
[dependencies]
1418
bitcoin = "0.27"
1519
lightning = { version = "0.0.104", path = "../lightning" }

lightning-net-tokio/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
#![deny(broken_intra_doc_links)]
7070
#![deny(missing_docs)]
7171

72+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
73+
7274
use bitcoin::secp256k1::key::PublicKey;
7375

7476
use tokio::net::TcpStream;

lightning-persister/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ description = """
88
Utilities to manage Rust-Lightning channel data persistence and retrieval.
99
"""
1010

11+
[package.metadata.docs.rs]
12+
all-features = true
13+
rustdoc-args = ["--cfg", "docsrs"]
14+
1115
[features]
1216
_bench_unstable = ["lightning/_bench_unstable"]
1317

lightning-persister/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#![deny(broken_intra_doc_links)]
44
#![deny(missing_docs)]
55

6+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
7+
68
#![cfg_attr(all(test, feature = "_bench_unstable"), feature(test))]
79
#[cfg(all(test, feature = "_bench_unstable"))] extern crate test;
810

lightning/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Does most of the hard work, without implying a specific runtime, requiring clien
1010
Still missing tons of error-handling. See GitHub issues for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to build a client around it to even try.
1111
"""
1212

13+
[package.metadata.docs.rs]
14+
features = ["std"]
15+
rustdoc-args = ["--cfg", "docsrs"]
16+
1317
[features]
1418
# Internal test utilities exposed to other repo crates
1519
_test_utils = ["hex", "regex", "bitcoin/bitcoinconsensus"]

lightning/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#![allow(bare_trait_objects)]
2929
#![allow(ellipsis_inclusive_range_patterns)]
3030

31+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
32+
3133
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
3234

3335
#![cfg_attr(all(any(test, feature = "_test_utils"), feature = "_bench_unstable"), feature(test))]

lightning/src/routing/scoring.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ type ConfiguredTime = time::Eternity;
246246
/// [`Score`] implementation.
247247
///
248248
/// (C-not exported) generally all users should use the [`Scorer`] type alias.
249-
#[doc(hidden)]
250249
pub struct ScorerUsingTime<T: Time> {
251250
params: ScoringParameters,
252251
// TODO: Remove entries of closed channels.
@@ -493,7 +492,6 @@ pub type ProbabilisticScorer<G> = ProbabilisticScorerUsingTime::<G, ConfiguredTi
493492
/// Probabilistic [`Score`] implementation.
494493
///
495494
/// (C-not exported) generally all users should use the [`ProbabilisticScorer`] type alias.
496-
#[doc(hidden)]
497495
pub struct ProbabilisticScorerUsingTime<G: Deref<Target = NetworkGraph>, T: Time> {
498496
params: ProbabilisticScoringParameters,
499497
network_graph: G,

lightning/src/util/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub enum Event {
235235
/// Note that this does *not* indicate that all paths for an MPP payment have failed, see
236236
/// [`Event::PaymentFailed`] and [`all_paths_failed`].
237237
///
238-
/// [`all_paths_failed`]: Self::all_paths_failed
238+
/// [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
239239
PaymentPathFailed {
240240
/// The id returned by [`ChannelManager::send_payment`] and used with
241241
/// [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].

0 commit comments

Comments
 (0)