Skip to content

Commit

Permalink
fix: Resolve Nightly Rustdoc errors and warnings (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz authored Mar 8, 2024
1 parent 2e79208 commit 4537dc2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
5 changes: 4 additions & 1 deletion commons/zenoh-buffers/src/bbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ use crate::{
writer::{BacktrackableWriter, DidntWrite, HasWriter, Writer},
ZSlice,
};
use alloc::{boxed::Box, sync::Arc};
use alloc::sync::Arc;
use core::{fmt, num::NonZeroUsize, option};

#[cfg(not(feature = "std"))]
use alloc::boxed::Box;

#[derive(Clone, PartialEq, Eq)]
pub struct BBuf {
buffer: Box<[u8]>,
Expand Down
4 changes: 3 additions & 1 deletion commons/zenoh-buffers/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ use crate::{
reader::HasReader,
writer::{BacktrackableWriter, DidntWrite, HasWriter, Writer},
};
use alloc::vec::Vec;
use core::{mem, num::NonZeroUsize, option};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Allocate a vector with a given capacity and sets the length to that capacity.
#[must_use]
pub fn uninit(capacity: usize) -> Vec<u8> {
Expand Down
1 change: 0 additions & 1 deletion commons/zenoh-collections/src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
//
use std::{
collections::HashMap,
convert::{From, TryFrom},
fmt,
ops::{Deref, DerefMut},
};
Expand Down
5 changes: 4 additions & 1 deletion commons/zenoh-collections/src/single_or_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use alloc::{vec, vec::Vec};
use alloc::vec;
use core::{
cmp::PartialEq,
fmt, iter,
ops::{Index, IndexMut, RangeBounds},
ptr, slice,
};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

#[derive(Clone, Eq)]
enum SingleOrVecInner<T> {
Single(T),
Expand Down
3 changes: 2 additions & 1 deletion commons/zenoh-result/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;

use alloc::boxed::Box;
use anyhow::Error as AnyError;
use core::fmt;

Expand All @@ -39,6 +38,8 @@ pub const fn unlikely(b: bool) -> bool {
b
}

#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
use core::any::Any;

Expand Down
2 changes: 1 addition & 1 deletion zenoh/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl<'a> AsyncResolve for PeersZidBuilder<'a> {
}
}

/// Struct returned by [`Session::info()`](crate::Session::info) which allows
/// Struct returned by [`Session::info()`](crate::SessionDeclarations::info) which allows
/// to access informations about the current zenoh [`Session`](crate::Session).
///
/// # Examples
Expand Down
4 changes: 2 additions & 2 deletions zenoh/src/key_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
//! # Storing Key Expressions
//! This module provides 3 flavours to store strings that have been validated to respect the KE syntax:
//! - [`keyexpr`] is the equivalent of a [`str`],
//! - [`OwnedKeyExpr`] works like an [`Arc<str>`],
//! - [`KeyExpr`] works like a [`Cow<str>`], but also stores some additional context internal to Zenoh to optimize
//! - [`OwnedKeyExpr`] works like an [`std::sync::Arc<str>`],
//! - [`KeyExpr`] works like a [`std::borrow::Cow<str>`], but also stores some additional context internal to Zenoh to optimize
//! routing and network usage.
//!
//! All of these types [`Deref`](core::ops::Deref) to [`keyexpr`], which notably has methods to check whether a given [`keyexpr::intersects`] with another,
Expand Down
2 changes: 1 addition & 1 deletion zenoh/src/plugins/sealed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub trait RunningPluginTrait: Send + Sync + PluginControl {
/// Parameters:
/// * `selector`: the full selector of the query (usually only key_expr part is used). This selector is
/// exactly the same as it was requested by user, for example "@/router/ROUTER_ID/plugins/PLUGIN_NAME/some/plugin/info" or "@/router/*/plugins/*/foo/bar".
/// But the plugin's [adminspace_getter] is called only if the selector matches the [plugin_status_key]
/// But the plugin's [RunningPluginTrait::adminspace_getter] is called only if the selector matches the `plugin_status_key`
/// * `plugin_status_key`: the actual path to plugin's status in the admin space. For example "@/router/ROUTER_ID/plugins/PLUGIN_NAME"
/// Returns value:
/// * `Ok(Vec<Response>)`: the list of responses to the query. For example if plugins can return information on subleys "foo", "bar", "foo/buzz" and "bar/buzz"
Expand Down
8 changes: 4 additions & 4 deletions zenoh/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl fmt::Debug for SubscriberState {
/// A subscriber that provides data through a callback.
///
/// CallbackSubscribers can be created from a zenoh [`Session`](crate::Session)
/// with the [`declare_subscriber`](crate::Session::declare_subscriber) function
/// with the [`declare_subscriber`](crate::SessionDeclarations::declare_subscriber) function
/// and the [`callback`](SubscriberBuilder::callback) function
/// of the resulting builder.
///
Expand Down Expand Up @@ -83,7 +83,7 @@ pub(crate) struct SubscriberInner<'a> {
/// CallbackPullSubscribers only provide data when explicitely pulled by the
/// application with the [`pull`](CallbackPullSubscriber::pull) function.
/// CallbackPullSubscribers can be created from a zenoh [`Session`](crate::Session)
/// with the [`declare_subscriber`](crate::Session::declare_subscriber) function,
/// with the [`declare_subscriber`](crate::SessionDeclarations::declare_subscriber) function,
/// the [`callback`](SubscriberBuilder::callback) function
/// and the [`pull_mode`](SubscriberBuilder::pull_mode) function
/// of the resulting builder.
Expand Down Expand Up @@ -628,7 +628,7 @@ where
/// A subscriber that provides data through a [`Handler`](crate::prelude::IntoCallbackReceiverPair).
///
/// Subscribers can be created from a zenoh [`Session`](crate::Session)
/// with the [`declare_subscriber`](crate::Session::declare_subscriber) function
/// with the [`declare_subscriber`](crate::SessionDeclarations::declare_subscriber) function
/// and the [`with`](SubscriberBuilder::with) function
/// of the resulting builder.
///
Expand Down Expand Up @@ -663,7 +663,7 @@ pub struct Subscriber<'a, Receiver> {
/// PullSubscribers only provide data when explicitely pulled by the
/// application with the [`pull`](PullSubscriber::pull) function.
/// PullSubscribers can be created from a zenoh [`Session`](crate::Session)
/// with the [`declare_subscriber`](crate::Session::declare_subscriber) function,
/// with the [`declare_subscriber`](crate::SessionDeclarations::declare_subscriber) function,
/// the [`with`](SubscriberBuilder::with) function
/// and the [`pull_mode`](SubscriberBuilder::pull_mode) function
/// of the resulting builder.
Expand Down

0 comments on commit 4537dc2

Please sign in to comment.