Skip to content

Commit a7d2b4f

Browse files
committed
chore: Clean up clippy lints
1 parent e8a3ccd commit a7d2b4f

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

labview-interop/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl From<LVStatusCode> for LVInteropError {
106106
/// Accoring to https://www.ni.com/docs/en-US/bundle/labview/page/labview-manager-function-errors.html
107107
/// the memory manager only uses a subset of this huge error list. The subset is implemented in `MgError` using
108108
/// the official abbreviations.
109-
109+
///
110110
/// in https://www.ni.com/docs/en-US/bundle/labview/page/labview-manager-function-errors.html
111111
/// `MgError` implements Error on top of the `MgErrorCode` and includes a description
112112
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error, IntoPrimitive, TryFromPrimitive)]
@@ -387,7 +387,7 @@ impl From<MgError> for LVStatusCode {
387387
/// let error_code: i32 = error.into();
388388
/// assert_eq!(error_code, 42);
389389
/// ```
390-
390+
///
391391
/// LVInteropError is our internal Error type
392392
/// in order to be able to easily convert it to LV ErrorClusters all Errors should possess an
393393
/// Error Code

labview-interop/src/memory/owned_handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<T: ?Sized + LVCopy + 'static> OwnedUHandle<T> {
218218
}
219219
}
220220

221-
impl<'a, T: ?Sized + LVCopy + 'static> UHandle<'a, T> {
221+
impl<T: ?Sized + LVCopy + 'static> UHandle<'_, T> {
222222
/// Try to create an owned handle from the current handle.
223223
///
224224
/// The owned handle will have its own handle to the data and

labview-interop/src/memory/uhandle.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::ops::{Deref, DerefMut};
2323
#[derive(PartialEq, Eq)]
2424
pub struct UHandle<'a, T: ?Sized + 'a>(pub *mut *mut T, pub PhantomData<&'a T>);
2525

26-
impl<'a, T: ?Sized> UHandle<'a, T> {
26+
impl<T: ?Sized> UHandle<'_, T> {
2727
/// Get a reference to the internal type. Errors if the pointer is null.
2828
///
2929
/// # Safety
@@ -107,7 +107,7 @@ impl<'a, T: ?Sized> UHandle<'a, T> {
107107
}
108108
}
109109

110-
impl<'a, T: ?Sized> Deref for UHandle<'a, T> {
110+
impl<T: ?Sized> Deref for UHandle<'_, T> {
111111
type Target = T;
112112

113113
/// Extract the target type.
@@ -118,7 +118,7 @@ impl<'a, T: ?Sized> Deref for UHandle<'a, T> {
118118
}
119119
}
120120

121-
impl<'a, T: ?Sized> DerefMut for UHandle<'a, T> {
121+
impl<T: ?Sized> DerefMut for UHandle<'_, T> {
122122
/// Deref to a mutable reference.
123123
///
124124
/// This will panic if the handle or internal pointer is null.
@@ -127,7 +127,7 @@ impl<'a, T: ?Sized> DerefMut for UHandle<'a, T> {
127127
}
128128
}
129129

130-
impl<'a, T: Debug + ?Sized> Debug for UHandle<'a, T> {
130+
impl<T: Debug + ?Sized> Debug for UHandle<'_, T> {
131131
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
132132
super::fmt_handle("UHandle", self, f)
133133
}
@@ -137,7 +137,7 @@ impl<'a, T: Debug + ?Sized> Debug for UHandle<'a, T> {
137137
mod uhandle_link_features {
138138
use super::*;
139139
use crate::memory::LVCopy;
140-
impl<'a, T: ?Sized> UHandle<'a, T> {
140+
impl<T: ?Sized> UHandle<'_, T> {
141141
/// Resize the handle to the desired size.
142142
///
143143
/// # Safety
@@ -149,7 +149,7 @@ mod uhandle_link_features {
149149
}
150150
}
151151

152-
impl<'a, T: ?Sized + LVCopy + 'static> UHandle<'a, T> {
152+
impl<T: ?Sized + LVCopy + 'static> UHandle<'_, T> {
153153
/// Copy the contents of one handle into another.
154154
///
155155
/// If other points to a null value then this will allocate a handle for the contents.
@@ -245,8 +245,8 @@ mod uhandle_link_features {
245245
/// # Safety
246246
///
247247
/// * UHandle memory is managed by the Labview Memory Manager, which is thread safe
248-
unsafe impl<'a, T: ?Sized> Send for UHandle<'a, T> {}
249-
unsafe impl<'a, T: ?Sized> Sync for UHandle<'a, T> {}
248+
unsafe impl<T: ?Sized> Send for UHandle<'_, T> {}
249+
unsafe impl<T: ?Sized> Sync for UHandle<'_, T> {}
250250

251251
#[cfg(test)]
252252
mod tests {

labview-interop/src/types/array/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl NumericArrayResizable for f64 {
7272
const TYPE_CODE: i32 = 0x0A;
7373
}
7474

75-
impl<'array, const D: usize, T: NumericArrayResizable> LVArrayHandle<'array, D, T> {
75+
impl<const D: usize, T: NumericArrayResizable> LVArrayHandle<'_, D, T> {
7676
/// Resize the array to the new size.
7777
pub fn resize_array(&mut self, new_dims: LVArrayDims<D>) -> Result<()> {
7878
// Check if they match so resize isn't needed.

labview-interop/src/types/lv_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ labview_layout!(
2121
}
2222
);
2323

24-
impl<'a> ErrorCluster<'a> {
24+
impl ErrorCluster<'_> {
2525
/// Does the error cluster contain an error.
2626
pub fn is_err(&self) -> bool {
2727
self.status.into()
@@ -142,7 +142,7 @@ mod error_cluster_link_features {
142142
use crate::errors::Result;
143143
use crate::types::boolean::{LV_FALSE, LV_TRUE};
144144

145-
impl<'a> ErrorCluster<'a> {
145+
impl ErrorCluster<'_> {
146146
/// Set a description and source in the format that LabVIEW will interpret for display.
147147
fn set_source(&mut self, source: &str, description: &str) -> Result<()> {
148148
// Probably a clever way to avoid this allocation but for now we will take it.

labview-interop/src/types/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl PartialEq for LStr {
144144
///
145145
/// Requires the link feature.
146146
#[cfg(feature = "link")]
147-
impl<'a> LStrHandle<'a> {
147+
impl LStrHandle<'_> {
148148
/// Set the string as a binary value against the handle.
149149
///
150150
/// This function will resize the handle based on the size of the input value.

0 commit comments

Comments
 (0)