Skip to content

Commit

Permalink
[#100] Fix clippy and doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Feb 11, 2024
1 parent 00f86e4 commit b4e088c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions iceoryx2/src/port/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use std::time::Duration;

use super::event_id::EventId;

/// Defines the failures that can occur when a [`Listen`]er is created with the
/// Defines the failures that can occur when a [`Listener`] is created with the
/// [`crate::service::port_factory::listener::PortFactoryListener`].
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum ListenerCreateError {
Expand Down Expand Up @@ -132,8 +132,8 @@ impl<Service: service::Service> Listener<Service> {
Ok(())
}

/// Returns the cached [`EventId`]s. Whenever [`Listen::try_wait()`],
/// [`Listen::timed_wait()`] or [`Listen::blocking_wait()`] is called the cache is reset
/// Returns the cached [`EventId`]s. Whenever [`Listener::try_wait()`],
/// [`Listener::timed_wait()`] or [`Listener::blocking_wait()`] is called the cache is reset
/// and filled with the events that where signaled since the last call. This cache can be
/// accessed until a new wait call resets and fills it again.
pub fn cache(&self) -> &[EventId] {
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2/src/port/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use iceoryx2_cal::named_concept::NamedConceptBuilder;
use iceoryx2_cal::{dynamic_storage::DynamicStorage, event::NotifierBuilder};
use std::{cell::UnsafeCell, rc::Rc};

/// Failures that can occur when a new [`Notify`]er is created with the
/// Failures that can occur when a new [`Notifier`] is created with the
/// [`crate::service::port_factory::notifier::PortFactoryNotifier`].
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum NotifierCreateError {
Expand All @@ -63,7 +63,7 @@ impl std::fmt::Display for NotifierCreateError {

impl std::error::Error for NotifierCreateError {}

/// Defines the failures that can occur while a [`Notify::notify()`] call.
/// Defines the failures that can occur while a [`Notifier::notify()`] call.
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum NotifierConnectionUpdateFailure {
OnlyPartialUpdate,
Expand Down
1 change: 0 additions & 1 deletion iceoryx2/src/port/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ impl<Service: service::Service, MessageType: Debug> Publisher<Service, MessageTy
/// [`crate::port::subscriber::Subscriber`] is corrupted or a seems to be dead, this callback
/// is called and depending on the returned [`DegrationAction`] measures will be taken.
pub fn set_degration_callback<
'publisher,
F: Fn(
service::static_config::StaticConfig,
UniquePublisherId,
Expand Down
8 changes: 4 additions & 4 deletions iceoryx2/src/port/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use super::port_identifiers::{UniquePublisherId, UniqueSubscriberId};
use super::update_connections::ConnectionFailure;
use super::DegrationCallback;

/// Defines the failure that can occur when receiving data with [`Subscribe::receive()`].
/// Defines the failure that can occur when receiving data with [`Subscriber::receive()`].
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum SubscriberReceiveError {
ExceedsMaxBorrowedSamples,
Expand All @@ -68,7 +68,7 @@ impl std::fmt::Display for SubscriberReceiveError {

impl std::error::Error for SubscriberReceiveError {}

/// Describes the failures when a new [`Subscribe`] is created via the
/// Describes the failures when a new [`Subscriber`] is created via the
/// [`crate::service::port_factory::subscriber::PortFactorySubscriber`].
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum SubscriberCreateError {
Expand Down Expand Up @@ -212,8 +212,8 @@ impl<Service: service::Service, MessageType: Debug> Subscriber<Service, MessageT
Ok(())
}

fn receive_from_connection<'subscriber>(
&'subscriber self,
fn receive_from_connection(
&self,
channel_id: usize,
connection: &mut Connection<Service>,
) -> Result<Option<Sample<MessageType, Service>>, SubscriberReceiveError> {
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2/src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use crate::service::header::publish_subscribe::Header;

/// It stores the payload and is acquired by the [`crate::port::subscriber::Subscriber`] whenever
/// it receives new data from a [`crate::port::publisher::Publisher`] via
/// [`crate::port::subscribe::Subscribe::receive()`].
/// [`crate::port::subscriber::Subscriber::receive()`].
#[derive(Debug)]
pub struct Sample<MessageType: Debug, Service: crate::service::Service> {
pub(crate) publisher_connections: Rc<PublisherConnections<Service>>,
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2/src/service/port_factory/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'factory, Service: service::Service> PortFactoryNotifier<'factory, Service>
}

/// Sets a default [`EventId`] for the [`Notifier`] that is used in
/// [`crate::port::notify::Notify::notify()`]
/// [`Notifier::notify()`]
pub fn default_event_id(mut self, value: EventId) -> Self {
self.default_event_id = value;
self
Expand Down

0 comments on commit b4e088c

Please sign in to comment.