Skip to content

Commit

Permalink
Fix Clippy needless_lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Nov 27, 2024
1 parent 0ba909a commit b448b08
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/cpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl<'a> CslStringListIterator<'a> {
}
}

impl<'a> Iterator for CslStringListIterator<'a> {
impl Iterator for CslStringListIterator<'_> {
type Item = CslStringListEntry;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/gcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct GcpRef<'a> {
_phantom: PhantomData<&'a gdal_sys::GDAL_GCP>,
}

impl<'p> GcpRef<'p> {
impl GcpRef<'_> {
/// Returns an unique identifier of the GCP, often numeric.
pub fn id(&self) -> String {
unsafe { CStr::from_ptr(self.inner.pszId) }
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl<'a> MetadataIter<'a> {
}
}

impl<'a> Iterator for MetadataIter<'a> {
impl Iterator for MetadataIter<'_> {
type Item = MetadataEntry;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions src/raster/rasterband.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,13 +1257,13 @@ impl Drop for HistogramCounts {
}
}

impl<'a> MajorObject for RasterBand<'a> {
impl MajorObject for RasterBand<'_> {
fn gdal_object_ptr(&self) -> GDALMajorObjectH {
self.c_rasterband
}
}

impl<'a> Metadata for RasterBand<'a> {}
impl Metadata for RasterBand<'_> {}

/// Represents a color interpretation of a RasterBand
#[derive(Debug, PartialEq, Eq)]
Expand Down
4 changes: 2 additions & 2 deletions src/vector/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ impl<'a> FieldValueIterator<'a> {
}
}

impl<'a> Iterator for FieldValueIterator<'a> {
impl Iterator for FieldValueIterator<'_> {
type Item = (String, Option<FieldValue>);

#[inline]
Expand Down Expand Up @@ -646,7 +646,7 @@ impl<'a> Iterator for FieldValueIterator<'a> {
}
}

impl<'a> Drop for Feature<'a> {
impl Drop for Feature<'_> {
fn drop(&mut self) {
unsafe {
gdal_sys::OGR_F_Destroy(self.c_feature);
Expand Down
6 changes: 3 additions & 3 deletions src/vector/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ pub struct Layer<'a> {
phantom: PhantomData<&'a Dataset>,
}

impl<'a> MajorObject for Layer<'a> {
impl MajorObject for Layer<'_> {
fn gdal_object_ptr(&self) -> GDALMajorObjectH {
self.c_layer
}
}

impl<'a> Metadata for Layer<'a> {}
impl Metadata for Layer<'_> {}

impl<'a> LayerAccess for Layer<'a> {
impl LayerAccess for Layer<'_> {
unsafe fn c_layer(&self) -> OGRLayerH {
self.c_layer
}
Expand Down
2 changes: 1 addition & 1 deletion src/vector/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct LayerOptions<'a> {

const EMPTY_LAYER_NAME: &str = "";

impl<'a> Default for LayerOptions<'a> {
impl Default for LayerOptions<'_> {
/// Returns creation options for a new layer with no name, no SRS and unknown geometry type.
fn default() -> Self {
LayerOptions {
Expand Down
4 changes: 2 additions & 2 deletions src/vector/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ impl<'a> Deref for ResultSet<'a> {
}
}

impl<'a> DerefMut for ResultSet<'a> {
impl DerefMut for ResultSet<'_> {
fn deref_mut(&mut self) -> &mut <Self as Deref>::Target {
&mut self.layer
}
}

impl<'a> Drop for ResultSet<'a> {
impl Drop for ResultSet<'_> {
fn drop(&mut self) {
unsafe { gdal_sys::GDALDatasetReleaseResultSet(self.dataset, self.layer.c_layer()) };
}
Expand Down
6 changes: 3 additions & 3 deletions src/vector/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@ impl<'a> Transaction<'a> {
}
}

impl<'a> Deref for Transaction<'a> {
impl Deref for Transaction<'_> {
type Target = Dataset;

fn deref(&self) -> &Self::Target {
self.dataset
}
}

impl<'a> DerefMut for Transaction<'a> {
impl DerefMut for Transaction<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.dataset
}
}

impl<'a> Drop for Transaction<'a> {
impl Drop for Transaction<'_> {
fn drop(&mut self) {
if self.rollback_on_drop {
// We silently swallow any errors, because we have no way to report them from a drop
Expand Down
2 changes: 1 addition & 1 deletion src/vsi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<'d> MemFileRef<'d> {
}
}

impl<'d> Drop for MemFileRef<'d> {
impl Drop for MemFileRef<'_> {
fn drop(&mut self) {
// try to unlink file
// if it fails, ignore - it probably was manually unlinked before
Expand Down

0 comments on commit b448b08

Please sign in to comment.