Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Reduce cargo doc warnings #8947

Merged
merged 6 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/authority-discovery/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub enum Role {
///
/// 4. Put addresses and signature as a record with the authority id as a key on a Kademlia DHT.
///
/// When constructed with either [`Role::PublishAndDiscover`] or [`Role::Publish`] a [`Worker`] will
/// When constructed with either [`Role::PublishAndDiscover`] or [`Role::Discover`] a [`Worker`] will
///
/// 1. Retrieve the current and next set of authorities.
///
Expand Down
8 changes: 4 additions & 4 deletions client/basic-authorship/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ use sc_proposer_metrics::MetricsLink as PrometheusMetrics;

/// Default block size limit in bytes used by [`Proposer`].
///
/// Can be overwritten by [`ProposerFactory::set_block_size_limit`].
/// Can be overwritten by [`ProposerFactory::set_default_block_size_limit`].
///
/// Be aware that there is also an upper packet size on what the networking code
/// will accept. If the block doesn't fit in such a package, it can not be
/// transferred to other nodes.
pub const DEFAULT_BLOCK_SIZE_LIMIT: usize = 4 * 1024 * 1024 + 512;

/// Proposer factory.
/// [`Proposer`] factory.
pub struct ProposerFactory<A, B, C, PR> {
spawn_handle: Box<dyn SpawnNamed>,
/// The client instance.
Expand All @@ -62,7 +62,7 @@ pub struct ProposerFactory<A, B, C, PR> {
metrics: PrometheusMetrics,
/// The default block size limit.
///
/// If no `block_size_limit` is passed to [`Proposer::propose`], this block size limit will be
/// If no `block_size_limit` is passed to [`sp_consensus::Proposer::propose`], this block size limit will be
/// used.
default_block_size_limit: usize,
telemetry: Option<TelemetryHandle>,
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<A, B, C, PR> ProposerFactory<A, B, C, PR> {
/// The default value for the block size limit is:
/// [`DEFAULT_BLOCK_SIZE_LIMIT`].
///
/// If there is no block size limit passed to [`Proposer::propose`], this value will be used.
/// If there is no block size limit passed to [`sp_consensus::Proposer::propose`], this value will be used.
pub fn set_default_block_size_limit(&mut self, limit: usize) {
self.default_block_size_limit = limit;
}
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/common/src/shared_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ impl<T> Drop for SharedDataLockedUpgradable<T> {
/// Created by [`SharedData::shared_data_locked`].
///
/// As long as this object isn't dropped, the shared data is held in a mutex guard and the shared
/// data is tagged as locked. Access to the shared data is provided through [`Deref`] and
/// [`DerefMut`]. The trick is to use [`Self::release_mutex`] to release the mutex, but still keep
/// data is tagged as locked. Access to the shared data is provided through [`Deref`](std::ops::Deref) and
/// [`DerefMut`](std::ops::DerefMut). The trick is to use [`Self::release_mutex`] to release the mutex, but still keep
/// the shared data locked. This means every other thread trying to access the shared data in this
/// time will need to wait until this lock is freed.
///
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/slots/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ impl<B: BlockT, T: SimpleSlotWorker<B> + Send> SlotWorker<B, <T::Proposer as Pro

/// Slot specific extension that the inherent data provider needs to implement.
pub trait InherentDataProviderExt {
/// The current timestamp that will be found in the [`InherentData`].
/// The current timestamp that will be found in the [`InherentData`](`sp_inherents::InherentData`).
fn timestamp(&self) -> Timestamp;

/// The current slot that will be found in the [`InherentData`].
/// The current slot that will be found in the [`InherentData`](`sp_inherents::InherentData`).
fn slot(&self) -> Slot;
}

Expand Down
7 changes: 3 additions & 4 deletions client/network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub struct Params<B: BlockT, H: ExHashT> {

/// Request response configuration for the block request protocol.
///
/// [`RequestResponseConfig`] [`name`] is used to tag outgoing block requests with the correct
/// [`RequestResponseConfig::name`] is used to tag outgoing block requests with the correct
/// protocol name. In addition all of [`RequestResponseConfig`] is used to handle incoming block
/// requests, if enabled.
///
Expand Down Expand Up @@ -171,7 +171,7 @@ pub enum TransactionImport {
None,
}

/// Fuure resolving to transaction import result.
/// Future resolving to transaction import result.
pub type TransactionImportFuture = Pin<Box<dyn Future<Output=TransactionImport> + Send>>;

/// Transaction pool interface
Expand Down Expand Up @@ -599,8 +599,7 @@ pub enum TransportConfig {

/// If true, allow connecting to private IPv4 addresses (as defined in
/// [RFC1918](https://tools.ietf.org/html/rfc1918)). Irrelevant for addresses that have
/// been passed in [`NetworkConfiguration::reserved_nodes`] or
/// [`NetworkConfiguration::boot_nodes`].
/// been passed in [`NetworkConfiguration::boot_nodes`].
allow_private_ipv4: bool,
gilescope marked this conversation as resolved.
Show resolved Hide resolved

/// Optional external implementation of a libp2p transport. Used in WASM contexts where we
Expand Down
4 changes: 2 additions & 2 deletions client/network/src/light_client_requests/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! 2. Forward the request to [`crate::request_responses::RequestResponsesBehaviour`] via
//! [`OutEvent::SendRequest`].
//!
//! 3. Wait for the response and forward the response via the [`oneshot::Sender`] provided earlier
//! 3. Wait for the response and forward the response via the [`futures::channel::oneshot::Sender`] provided earlier
//! with [`LightClientRequestSender::send_request`].

use codec::{self, Encode, Decode};
Expand Down Expand Up @@ -552,7 +552,7 @@ pub enum OutEvent {
target: PeerId,
/// The encoded request.
request: Vec<u8>,
/// The [`onehsot::Sender`] channel to pass the response to.
/// The [`oneshot::Sender`] channel to pass the response to.
pending_response: oneshot::Sender<Result<Vec<u8>, RequestFailure>>,
/// The name of the protocol to use to send the request.
protocol_name: String,
Expand Down
2 changes: 1 addition & 1 deletion client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkService<B, H> {
}
}

/// You may call this when new transactons are imported by the transaction pool.
/// You may call this when new transactions are imported by the transaction pool.
///
/// All transactions will be fetched from the `TransactionPool` that was passed at
/// initialization as part of the configuration and propagated to peers.
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub type Weight = u64;
///
/// As 1 gas is equal to 1 weight we base this on the conducted benchmarks which
/// determined runtime weights:
/// https://github.com/paritytech/substrate/pull/5446
/// <https://github.com/paritytech/substrate/pull/5446>
const GAS_PER_SECOND: Weight = 1_000_000_000_000;

/// The maximum amount of weight that the call and instantiate rpcs are allowed to consume.
Expand Down
2 changes: 2 additions & 0 deletions primitives/npos-elections/compact/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ fn check_compact_attr(input: ParseStream) -> Result<bool> {
}
}

/// ```ignore
gilescope marked this conversation as resolved.
Show resolved Hide resolved
/// #[compact] pub struct CompactName::<VoterIndex = u32, TargetIndex = u32, Accuracy = u32>()
gilescope marked this conversation as resolved.
Show resolved Hide resolved
/// ```
gilescope marked this conversation as resolved.
Show resolved Hide resolved
impl Parse for SolutionDef {
fn parse(input: ParseStream) -> syn::Result<Self> {
// optional #[compact]
Expand Down