From e6da99e4f8af23e1a3323580172d2da17bab1760 Mon Sep 17 00:00:00 2001 From: David D Date: Mon, 3 Oct 2022 19:01:45 -0600 Subject: [PATCH] .github/workflows: Deny cargo doc warnings in CI (#2936) Co-authored-by: Thomas Eizinger --- .github/workflows/ci.yml | 2 +- protocols/gossipsub/src/config.rs | 8 ++++---- protocols/gossipsub/src/lib.rs | 2 +- swarm/src/dial_opts.rs | 4 ++-- swarm/src/lib.rs | 10 ++++++++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 819db071c45..0519e048c71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: - uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 - name: Check rustdoc links - run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items --all-features + run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links --deny warnings" cargo doc --verbose --workspace --no-deps --all-features check-clippy: runs-on: ubuntu-latest diff --git a/protocols/gossipsub/src/config.rs b/protocols/gossipsub/src/config.rs index a0a8d5e46a1..34956fe614c 100644 --- a/protocols/gossipsub/src/config.rs +++ b/protocols/gossipsub/src/config.rs @@ -267,7 +267,7 @@ impl GossipsubConfig { /// connected/trusted nodes. The default is false. /// /// Note: Peer exchange is not implemented today, see - /// https://github.com/libp2p/rust-libp2p/issues/2398. + /// . pub fn do_px(&self) -> bool { self.do_px } @@ -334,7 +334,7 @@ impl GossipsubConfig { /// Number of heartbeat ticks that specifcy the interval in which opportunistic grafting is /// applied. Every `opportunistic_graft_ticks` we will attempt to select some high-scoring mesh /// peers to replace lower-scoring ones, if the median score of our mesh peers falls below a - /// threshold (see https://godoc.org/github.com/libp2p/go-libp2p-pubsub#PeerScoreThresholds). + /// threshold (see ). /// The default is 60. pub fn opportunistic_graft_ticks(&self) -> u64 { self.opportunistic_graft_ticks @@ -650,7 +650,7 @@ impl GossipsubConfigBuilder { /// connected/trusted nodes. The default is false. /// /// Note: Peer exchange is not implemented today, see - /// https://github.com/libp2p/rust-libp2p/issues/2398. + /// . pub fn do_px(&mut self) -> &mut Self { self.config.do_px = true; self @@ -725,7 +725,7 @@ impl GossipsubConfigBuilder { /// Number of heartbeat ticks that specifcy the interval in which opportunistic grafting is /// applied. Every `opportunistic_graft_ticks` we will attempt to select some high-scoring mesh /// peers to replace lower-scoring ones, if the median score of our mesh peers falls below a - /// threshold (see https://godoc.org/github.com/libp2p/go-libp2p-pubsub#PeerScoreThresholds). + /// threshold (see ). /// The default is 60. pub fn opportunistic_graft_ticks(&mut self, opportunistic_graft_ticks: u64) -> &mut Self { self.config.opportunistic_graft_ticks = opportunistic_graft_ticks; diff --git a/protocols/gossipsub/src/lib.rs b/protocols/gossipsub/src/lib.rs index 95ce1e761b0..4f00f82ba36 100644 --- a/protocols/gossipsub/src/lib.rs +++ b/protocols/gossipsub/src/lib.rs @@ -24,7 +24,7 @@ //! # Overview //! //! *Note: The gossipsub protocol specifications -//! (https://github.com/libp2p/specs/tree/master/pubsub/gossipsub) provide an outline for the +//! () provide an outline for the //! routing protocol. They should be consulted for further detail.* //! //! Gossipsub is a blend of meshsub for data and randomsub for mesh metadata. It provides bounded diff --git a/swarm/src/dial_opts.rs b/swarm/src/dial_opts.rs index ac6b771ced8..edc69484b68 100644 --- a/swarm/src/dial_opts.rs +++ b/swarm/src/dial_opts.rs @@ -122,7 +122,7 @@ impl WithPeerId { } /// Override - /// [`PoolConfig::with_dial_concurrency_factor`](crate::connection::pool::PoolConfig::with_dial_concurrency_factor). + /// Number of addresses concurrently dialed for a single outbound connection attempt. pub fn override_dial_concurrency_factor(mut self, factor: NonZeroU8) -> Self { self.dial_concurrency_factor_override = Some(factor); self @@ -196,7 +196,7 @@ impl WithPeerIdWithAddresses { } /// Override - /// [`PoolConfig::with_dial_concurrency_factor`](crate::connection::pool::PoolConfig::with_dial_concurrency_factor). + /// Number of addresses concurrently dialed for a single outbound connection attempt. pub fn override_dial_concurrency_factor(mut self, factor: NonZeroU8) -> Self { self.dial_concurrency_factor_override = Some(factor); self diff --git a/swarm/src/lib.rs b/swarm/src/lib.rs index 94f5215e91e..3715c08b2db 100644 --- a/swarm/src/lib.rs +++ b/swarm/src/lib.rs @@ -1368,9 +1368,15 @@ where self } - /// The maximum number of inbound streams concurrently negotiating on a connection. + /// The maximum number of inbound streams concurrently negotiating on a + /// connection. New inbound streams exceeding the limit are dropped and thus + /// reset. /// - /// See [`PoolConfig::with_max_negotiating_inbound_streams`]. + /// Note: This only enforces a limit on the number of concurrently + /// negotiating inbound streams. The total number of inbound streams on a + /// connection is the sum of negotiating and negotiated streams. A limit on + /// the total number of streams can be enforced at the + /// [`StreamMuxerBox`](libp2p_core::muxing::StreamMuxerBox) level. pub fn max_negotiating_inbound_streams(mut self, v: usize) -> Self { self.pool_config = self.pool_config.with_max_negotiating_inbound_streams(v); self