Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoll committed Jan 10, 2025
1 parent b84834e commit 21129f6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/async_monitored_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl MonitoredItemBuilder {

/// Sets sampling interval.
///
/// Default value is 250.0 [ms].
/// Default value is 250.0 ms.
///
/// See [`ua::MonitoringParameters::with_sampling_interval()`].
#[must_use]
Expand Down
2 changes: 1 addition & 1 deletion src/async_subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct SubscriptionBuilder {
impl SubscriptionBuilder {
/// Sets requested publishing interval.
///
/// Default value is 500.0 [ms].
/// Default value is 500.0 ms.
///
/// See [`ua::CreateSubscriptionRequest::with_requested_publishing_interval()`].
#[must_use]
Expand Down
1 change: 1 addition & 0 deletions src/ua/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ impl<T: DataType> Array<T> {
///
/// Ownership is transferred. There must not be any aliased references to the array elements, as
/// they will be owned and freed when the returned value is dropped.
#[allow(dead_code)] // --no-default-features
pub(crate) unsafe fn move_from_raw_parts(
size: &mut usize,
ptr: &mut *mut T::Inner,
Expand Down
1 change: 1 addition & 0 deletions src/ua/data_types/create_monitored_items_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ impl CreateMonitoredItemsRequest {
self
}

#[allow(dead_code)] // --no-default-features
#[must_use]
pub(crate) fn items_to_create(&self) -> Option<&[ua::MonitoredItemCreateRequest]> {
unsafe { ua::Array::slice_from_raw_parts(self.0.itemsToCreateSize, self.0.itemsToCreate) }
Expand Down
1 change: 1 addition & 0 deletions src/ua/data_types/create_monitored_items_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ impl CreateMonitoredItemsResponse {
unsafe { ua::Array::slice_from_raw_parts(self.0.resultsSize, self.0.results) }
}

#[allow(dead_code)] // --no-default-features
pub(crate) fn into_results(mut self) -> Option<ua::Array<ua::MonitoredItemCreateResult>> {
unsafe { ua::Array::move_from_raw_parts(&mut self.0.resultsSize, &mut self.0.results) }
}
Expand Down
2 changes: 2 additions & 0 deletions src/ua/data_types/monitored_item_create_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ use crate::{ua, Error, Result};
crate::data_type!(MonitoredItemCreateResult);

impl MonitoredItemCreateResult {
#[allow(dead_code)] // --no-default-features
#[must_use]
pub(crate) const fn status_code(&self) -> ua::StatusCode {
ua::StatusCode::new(self.0.statusCode)
}

#[allow(dead_code)] // --no-default-features
#[must_use]
pub(crate) const fn monitored_item_id(&self) -> ua::MonitoredItemId {
ua::MonitoredItemId::new(self.0.monitoredItemId)
Expand Down
1 change: 1 addition & 0 deletions src/ua/monitored_item_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::ua;
pub struct MonitoredItemId(u32);

impl MonitoredItemId {
#[allow(dead_code)] // --no-default-features
#[must_use]
pub(crate) const fn new(id: u32) -> Self {
Self(id)
Expand Down

0 comments on commit 21129f6

Please # to comment.