Skip to content

Commit

Permalink
#13 fixed nightly clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Evans committed Oct 21, 2024
1 parent fe15b1a commit ccf0b8e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions omf-c/src/ffi_tools/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::error::{Error, InvalidArg};
/// # Safety
///
/// Pointer must be null or valid. See `core::ptr::const_ptr::as_ref` for details.
pub unsafe fn ref_from_ptr<T>(arg_name: &'static str, ptr: *const T) -> Result<&T, Error> {
pub unsafe fn ref_from_ptr<'a, T>(arg_name: &'static str, ptr: *const T) -> Result<&'a T, Error> {
unsafe { ptr.as_ref() }.ok_or(InvalidArg::Null(arg_name).into())
}

Expand All @@ -16,7 +16,7 @@ pub unsafe fn ref_from_ptr<T>(arg_name: &'static str, ptr: *const T) -> Result<&
/// # Safety
///
/// Pointer must be null or valid. See `core::ptr::const_ptr::as_mut` for details.
pub unsafe fn mut_from_ptr<T>(arg_name: &'static str, ptr: *mut T) -> Result<&mut T, Error> {
pub unsafe fn mut_from_ptr<'a, T>(arg_name: &'static str, ptr: *mut T) -> Result<&'a mut T, Error> {
unsafe { ptr.as_mut() }.ok_or(InvalidArg::Null(arg_name).into())
}

Expand Down
4 changes: 2 additions & 2 deletions src/file/zip_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ pub(crate) struct SubFileWrite<'a> {
inner: &'a mut ZipWriter<File>,
}

impl<'a> SubFileWrite<'a> {
impl SubFileWrite<'_> {
pub fn name(&self) -> &str {
&self.name
}
}

impl<'a> std::io::Write for SubFileWrite<'a> {
impl std::io::Write for SubFileWrite<'_> {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
self.inner.write(buf)
}
Expand Down
4 changes: 2 additions & 2 deletions src/omf1/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Project {
}
}

impl<'a> ElementModel<'a> {
impl ElementModel<'_> {
pub fn convert(&self, r: &Omf1Reader, w: &mut Writer) -> Result<crate::Element, Error> {
match *self {
Self::PointSetElement(x) => x.convert(r, w),
Expand Down Expand Up @@ -177,7 +177,7 @@ impl VolumeElement {
}
}

impl<'a> DataModel<'a> {
impl DataModel<'_> {
pub fn convert(&self, r: &Omf1Reader, w: &mut Writer) -> Result<crate::Attribute, Error> {
match *self {
DataModel::ScalarData(x) => x.convert(r, w),
Expand Down
2 changes: 1 addition & 1 deletion src/omf1/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct KeyVisitor<T> {
_phantom: PhantomData<T>,
}

impl<'de, T> serde::de::Visitor<'de> for KeyVisitor<T> {
impl<T> serde::de::Visitor<'_> for KeyVisitor<T> {
type Value = Key<T>;

fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion src/pqarray/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub trait RowGrouper {
fn next_column(&mut self) -> Result<Option<SerializedColumnWriter<'_>>, ParquetError>;
}

impl<'a, W: Write + Send> RowGrouper for SerializedRowGroupWriter<'a, W> {
impl<W: Write + Send> RowGrouper for SerializedRowGroupWriter<'_, W> {
fn next_column(&mut self) -> Result<Option<SerializedColumnWriter<'_>>, ParquetError> {
SerializedRowGroupWriter::next_column(self)
}
Expand Down

0 comments on commit ccf0b8e

Please sign in to comment.