From 5110de412edd280d6c705c2b2b1bbfbc2c8cb7e2 Mon Sep 17 00:00:00 2001 From: Michael Macias Date: Sat, 30 Nov 2024 16:08:39 -0600 Subject: [PATCH] Fix warnings These were introduced in rustc 1.83.0 (90b35a623 2024-11-26): * `clippy::empty_line_after_doc_comments`, * `clippy::needless_lifetimes`, * `clippy::needless_return`, * `elided_named_lifetimes`, and * `non_local_definitions`. --- noodles-bam/src/async/io/reader.rs | 2 +- noodles-bam/src/io/indexed_reader.rs | 4 +-- noodles-bam/src/io/reader.rs | 2 +- noodles-bam/src/io/reader/query.rs | 2 +- noodles-bam/src/io/reader/record_bufs.rs | 2 +- noodles-bam/src/io/reader/records.rs | 2 +- noodles-bam/src/record/cigar.rs | 6 ++--- noodles-bam/src/record/data.rs | 6 ++--- .../record/data/field/value/array/values.rs | 14 +++++----- noodles-bam/src/record/quality_scores.rs | 4 +-- noodles-bam/src/record/sequence.rs | 8 +++--- noodles-bam/src/record/sequence/iter.rs | 8 +++--- .../src/record/sequence/subsequence.rs | 2 +- noodles-bcf/src/io/reader/query.rs | 2 +- noodles-bcf/src/io/reader/record_bufs.rs | 2 +- noodles-bcf/src/record/alternate_bases.rs | 4 +-- noodles-bcf/src/record/codec/value.rs | 2 +- noodles-bcf/src/record/codec/value/array.rs | 2 +- .../src/record/codec/value/array/values.rs | 2 +- noodles-bcf/src/record/filters.rs | 4 +-- noodles-bcf/src/record/ids.rs | 4 +-- noodles-bcf/src/record/info.rs | 4 +-- noodles-bcf/src/record/info/field/value.rs | 2 +- noodles-bcf/src/record/reference_bases.rs | 4 +-- noodles-bcf/src/record/samples.rs | 4 +-- noodles-bcf/src/record/samples/sample.rs | 2 +- noodles-bcf/src/record/samples/series.rs | 2 +- noodles-bcf/src/record/value.rs | 2 +- noodles-bcf/src/record/value/array/values.rs | 10 +++---- noodles-bed/src/record/other_fields.rs | 4 +-- noodles-bgzf/src/async/reader.rs | 2 +- noodles-cram/src/crai/async.rs | 1 - .../compression_header/encoding/codec/byte.rs | 2 +- .../encoding/codec/integer.rs | 2 +- noodles-cram/src/io/reader.rs | 2 +- noodles-cram/src/io/reader/query.rs | 2 +- noodles-cram/src/io/reader/records.rs | 2 +- noodles-cram/src/record.rs | 2 +- noodles-cram/src/record/features/cigar.rs | 2 +- noodles-csi/src/io/filter_by_region.rs | 26 +++++++++---------- noodles-csi/src/io/query.rs | 6 ++--- noodles-fasta/src/io/reader/records.rs | 2 +- noodles-fasta/src/io/reader/sequence.rs | 4 +-- .../src/record/sequence/complement.rs | 8 +++--- noodles-fastq/src/io/reader/records.rs | 2 +- noodles-gff/src/directive.rs | 2 +- noodles-gff/src/io/reader/line_bufs.rs | 2 +- noodles-gff/src/io/reader/record_bufs.rs | 2 +- noodles-gff/src/record.rs | 2 +- noodles-gff/src/record/attributes.rs | 4 +-- .../src/record/attributes/field/value.rs | 2 +- .../record/attributes/field/value/array.rs | 4 +-- noodles-htsget/src/request/payload/regions.rs | 2 +- .../src/alignment/record/data/field/value.rs | 2 +- .../record/data/field/value/array.rs | 4 +-- noodles-sam/src/io/reader/query.rs | 2 +- noodles-sam/src/io/reader/record_bufs.rs | 2 +- noodles-sam/src/record/cigar.rs | 6 ++--- noodles-sam/src/record/data.rs | 6 ++--- noodles-sam/src/record/quality_scores.rs | 4 +-- noodles-sam/src/record/sequence.rs | 4 +-- noodles-util/src/alignment/iter/pileup.rs | 2 +- noodles-util/src/variant/io/indexed_reader.rs | 6 ++--- noodles-vcf/src/io/reader/query.rs | 2 +- noodles-vcf/src/io/reader/record_bufs.rs | 2 +- noodles-vcf/src/record/alternate_bases.rs | 6 ++--- noodles-vcf/src/record/filters.rs | 4 +-- noodles-vcf/src/record/ids.rs | 4 +-- noodles-vcf/src/record/info.rs | 4 +-- noodles-vcf/src/record/samples.rs | 6 ++--- noodles-vcf/src/record/samples/sample.rs | 6 ++--- noodles-vcf/src/record/samples/series.rs | 2 +- .../record/samples/series/value/genotype.rs | 2 +- .../variant/record/info/field/value/array.rs | 2 +- .../record/samples/series/value/array.rs | 2 +- .../src/variant/record_buf/samples/sample.rs | 4 +-- .../src/variant/record_buf/samples/series.rs | 2 +- 77 files changed, 143 insertions(+), 146 deletions(-) diff --git a/noodles-bam/src/async/io/reader.rs b/noodles-bam/src/async/io/reader.rs index 22f0a4164..f5a5055d2 100644 --- a/noodles-bam/src/async/io/reader.rs +++ b/noodles-bam/src/async/io/reader.rs @@ -230,7 +230,7 @@ where pub fn record_bufs<'a>( &'a mut self, _header: &'a sam::Header, - ) -> impl Stream> + '_ { + ) -> impl Stream> + 'a { Box::pin(stream::try_unfold( (&mut self.inner, &mut self.buf, RecordBuf::default()), move |(reader, buf, mut record)| async move { diff --git a/noodles-bam/src/io/indexed_reader.rs b/noodles-bam/src/io/indexed_reader.rs index 5a559784b..1b42e95bd 100644 --- a/noodles-bam/src/io/indexed_reader.rs +++ b/noodles-bam/src/io/indexed_reader.rs @@ -64,7 +64,7 @@ where /// Returns an iterator over alignment record buffers starting from the current stream /// position. - pub fn record_bufs<'a>(&'a mut self, header: &'a sam::Header) -> RecordBufs<'_, R> { + pub fn record_bufs<'a>(&'a mut self, header: &'a sam::Header) -> RecordBufs<'a, R> { self.inner.record_bufs(header) } @@ -104,7 +104,7 @@ where &'a mut self, header: &'a sam::Header, region: &Region, - ) -> io::Result> { + ) -> io::Result> { self.inner.query(header, &self.index, region) } diff --git a/noodles-bam/src/io/reader.rs b/noodles-bam/src/io/reader.rs index 5dc7b2308..033a8c547 100644 --- a/noodles-bam/src/io/reader.rs +++ b/noodles-bam/src/io/reader.rs @@ -251,7 +251,7 @@ where /// } /// # Ok::<_, io::Error>(()) /// ``` - pub fn record_bufs<'a>(&'a mut self, header: &'a sam::Header) -> RecordBufs<'_, R> { + pub fn record_bufs<'a>(&'a mut self, header: &'a sam::Header) -> RecordBufs<'a, R> { RecordBufs::new(self, header) } diff --git a/noodles-bam/src/io/reader/query.rs b/noodles-bam/src/io/reader/query.rs index 757fd5156..caded9f73 100644 --- a/noodles-bam/src/io/reader/query.rs +++ b/noodles-bam/src/io/reader/query.rs @@ -37,7 +37,7 @@ where } } -impl<'a, R> Iterator for Query<'a, R> +impl Iterator for Query<'_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { diff --git a/noodles-bam/src/io/reader/record_bufs.rs b/noodles-bam/src/io/reader/record_bufs.rs index b5f227ca4..8738f2afc 100644 --- a/noodles-bam/src/io/reader/record_bufs.rs +++ b/noodles-bam/src/io/reader/record_bufs.rs @@ -29,7 +29,7 @@ where } } -impl<'a, R> Iterator for RecordBufs<'a, R> +impl Iterator for RecordBufs<'_, R> where R: Read, { diff --git a/noodles-bam/src/io/reader/records.rs b/noodles-bam/src/io/reader/records.rs index 0f40ec72f..908667c2c 100644 --- a/noodles-bam/src/io/reader/records.rs +++ b/noodles-bam/src/io/reader/records.rs @@ -23,7 +23,7 @@ where } } -impl<'a, R> Iterator for Records<'a, R> +impl Iterator for Records<'_, R> where R: Read, { diff --git a/noodles-bam/src/record/cigar.rs b/noodles-bam/src/record/cigar.rs index 60ca64aa9..278ac3ba2 100644 --- a/noodles-bam/src/record/cigar.rs +++ b/noodles-bam/src/record/cigar.rs @@ -39,7 +39,7 @@ impl<'a> Cigar<'a> { } } -impl<'a> sam::alignment::record::Cigar for Cigar<'a> { +impl sam::alignment::record::Cigar for Cigar<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -53,13 +53,13 @@ impl<'a> sam::alignment::record::Cigar for Cigar<'a> { } } -impl<'a> AsRef<[u8]> for Cigar<'a> { +impl AsRef<[u8]> for Cigar<'_> { fn as_ref(&self) -> &[u8] { self.0 } } -impl<'a> fmt::Debug for Cigar<'a> { +impl fmt::Debug for Cigar<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.iter()).finish() } diff --git a/noodles-bam/src/record/data.rs b/noodles-bam/src/record/data.rs index dabe44611..bcc0cac17 100644 --- a/noodles-bam/src/record/data.rs +++ b/noodles-bam/src/record/data.rs @@ -57,7 +57,7 @@ impl<'a> Data<'a> { } } -impl<'a> fmt::Debug for Data<'a> { +impl fmt::Debug for Data<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut formatter = f.debug_map(); @@ -70,7 +70,7 @@ impl<'a> fmt::Debug for Data<'a> { } } -impl<'a> sam::alignment::record::Data for Data<'a> { +impl sam::alignment::record::Data for Data<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -84,7 +84,7 @@ impl<'a> sam::alignment::record::Data for Data<'a> { } } -impl<'a> AsRef<[u8]> for Data<'a> { +impl AsRef<[u8]> for Data<'_> { fn as_ref(&self) -> &[u8] { self.0 } diff --git a/noodles-bam/src/record/data/field/value/array/values.rs b/noodles-bam/src/record/data/field/value/array/values.rs index efe2164ce..9cf566d84 100644 --- a/noodles-bam/src/record/data/field/value/array/values.rs +++ b/noodles-bam/src/record/data/field/value/array/values.rs @@ -18,7 +18,7 @@ impl<'a, N> Values<'a, N> { } } -impl<'a> Values<'a, i8> { +impl Values<'_, i8> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.iter().map(|&b| Ok(b as i8)) @@ -35,7 +35,7 @@ impl<'a> sam::alignment::record::data::field::value::array::Values<'a, i8> for V } } -impl<'a> Values<'a, u8> { +impl Values<'_, u8> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.iter().copied().map(Ok) @@ -52,7 +52,7 @@ impl<'a> sam::alignment::record::data::field::value::array::Values<'a, u8> for V } } -impl<'a> Values<'a, i16> { +impl Values<'_, i16> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.chunks(mem::size_of::()).map(|chunk| { @@ -74,7 +74,7 @@ impl<'a> sam::alignment::record::data::field::value::array::Values<'a, i16> for } } -impl<'a> Values<'a, u16> { +impl Values<'_, u16> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.chunks(mem::size_of::()).map(|chunk| { @@ -96,7 +96,7 @@ impl<'a> sam::alignment::record::data::field::value::array::Values<'a, u16> for } } -impl<'a> Values<'a, i32> { +impl Values<'_, i32> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.chunks(mem::size_of::()).map(|chunk| { @@ -118,7 +118,7 @@ impl<'a> sam::alignment::record::data::field::value::array::Values<'a, i32> for } } -impl<'a> Values<'a, u32> { +impl Values<'_, u32> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.chunks(mem::size_of::()).map(|chunk| { @@ -140,7 +140,7 @@ impl<'a> sam::alignment::record::data::field::value::array::Values<'a, u32> for } } -impl<'a> Values<'a, f32> { +impl Values<'_, f32> { /// Returns an iterator over values. pub fn iter(&self) -> impl Iterator> + '_ { self.src.chunks(mem::size_of::()).map(|chunk| { diff --git a/noodles-bam/src/record/quality_scores.rs b/noodles-bam/src/record/quality_scores.rs index 967c03196..521f11c83 100644 --- a/noodles-bam/src/record/quality_scores.rs +++ b/noodles-bam/src/record/quality_scores.rs @@ -22,7 +22,7 @@ impl<'a> QualityScores<'a> { } } -impl<'a> sam::alignment::record::QualityScores for QualityScores<'a> { +impl sam::alignment::record::QualityScores for QualityScores<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -36,7 +36,7 @@ impl<'a> sam::alignment::record::QualityScores for QualityScores<'a> { } } -impl<'a> AsRef<[u8]> for QualityScores<'a> { +impl AsRef<[u8]> for QualityScores<'_> { fn as_ref(&self) -> &[u8] { self.0 } diff --git a/noodles-bam/src/record/sequence.rs b/noodles-bam/src/record/sequence.rs index 683169b09..5d33100e9 100644 --- a/noodles-bam/src/record/sequence.rs +++ b/noodles-bam/src/record/sequence.rs @@ -69,7 +69,7 @@ impl<'a> Sequence<'a> { } } -impl<'a> sam::alignment::record::Sequence for Sequence<'a> { +impl sam::alignment::record::Sequence for Sequence<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -102,17 +102,17 @@ impl<'a> sam::alignment::record::Sequence for Sequence<'a> { } } -impl<'a> AsRef<[u8]> for Sequence<'a> { +impl AsRef<[u8]> for Sequence<'_> { fn as_ref(&self) -> &[u8] { self.src } } -impl<'a> fmt::Debug for Sequence<'a> { +impl fmt::Debug for Sequence<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { struct BasesFormat<'a>(&'a Sequence<'a>); - impl<'a> fmt::Debug for BasesFormat<'a> { + impl fmt::Debug for BasesFormat<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_char('"')?; diff --git a/noodles-bam/src/record/sequence/iter.rs b/noodles-bam/src/record/sequence/iter.rs index ef7c1d188..1570dc16f 100644 --- a/noodles-bam/src/record/sequence/iter.rs +++ b/noodles-bam/src/record/sequence/iter.rs @@ -41,7 +41,7 @@ impl<'a> Iter<'a> { } } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = u8; fn next(&mut self) -> Option { @@ -62,7 +62,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { fn next_back(&mut self) -> Option { loop { if let Some(base) = self.back.as_mut().and_then(|iter| iter.next_back()) { @@ -77,9 +77,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> { } } -impl<'a> ExactSizeIterator for Iter<'a> {} +impl ExactSizeIterator for Iter<'_> {} -impl<'a> FusedIterator for Iter<'a> {} +impl FusedIterator for Iter<'_> {} pub(super) fn decoded_bases(n: u8) -> array::IntoIter { [decode_base(n >> 4), decode_base(n)].into_iter() diff --git a/noodles-bam/src/record/sequence/subsequence.rs b/noodles-bam/src/record/sequence/subsequence.rs index 083260111..ea3c65454 100644 --- a/noodles-bam/src/record/sequence/subsequence.rs +++ b/noodles-bam/src/record/sequence/subsequence.rs @@ -64,7 +64,7 @@ impl<'a> Subsequence<'a> { } } -impl<'a> sam::alignment::record::Sequence for Subsequence<'a> { +impl sam::alignment::record::Sequence for Subsequence<'_> { fn is_empty(&self) -> bool { self.is_empty() } diff --git a/noodles-bcf/src/io/reader/query.rs b/noodles-bcf/src/io/reader/query.rs index 1bc1ec953..27bd9ce31 100644 --- a/noodles-bcf/src/io/reader/query.rs +++ b/noodles-bcf/src/io/reader/query.rs @@ -40,7 +40,7 @@ where } } -impl<'r, 'h, R> Iterator for Query<'r, 'h, R> +impl Iterator for Query<'_, '_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { diff --git a/noodles-bcf/src/io/reader/record_bufs.rs b/noodles-bcf/src/io/reader/record_bufs.rs index 69490eea5..e1dabef87 100644 --- a/noodles-bcf/src/io/reader/record_bufs.rs +++ b/noodles-bcf/src/io/reader/record_bufs.rs @@ -29,7 +29,7 @@ where } } -impl<'r, 'h, R> Iterator for RecordBufs<'r, 'h, R> +impl Iterator for RecordBufs<'_, '_, R> where R: Read, { diff --git a/noodles-bcf/src/record/alternate_bases.rs b/noodles-bcf/src/record/alternate_bases.rs index 01145bb67..0cd13c63d 100644 --- a/noodles-bcf/src/record/alternate_bases.rs +++ b/noodles-bcf/src/record/alternate_bases.rs @@ -15,13 +15,13 @@ impl<'a> AlternateBases<'a> { } } -impl<'a> AsRef<[u8]> for AlternateBases<'a> { +impl AsRef<[u8]> for AlternateBases<'_> { fn as_ref(&self) -> &[u8] { self.src } } -impl<'a> vcf::variant::record::AlternateBases for AlternateBases<'a> { +impl vcf::variant::record::AlternateBases for AlternateBases<'_> { fn is_empty(&self) -> bool { self.len == 0 } diff --git a/noodles-bcf/src/record/codec/value.rs b/noodles-bcf/src/record/codec/value.rs index 6fa981314..44615de1b 100644 --- a/noodles-bcf/src/record/codec/value.rs +++ b/noodles-bcf/src/record/codec/value.rs @@ -17,7 +17,7 @@ pub enum Value<'a> { Array(Array<'a>), } -impl<'a> Value<'a> { +impl Value<'_> { pub fn as_int(&self) -> Option { match self { Self::Int8(Some(Int8::Value(n))) => Some(i32::from(*n)), diff --git a/noodles-bcf/src/record/codec/value/array.rs b/noodles-bcf/src/record/codec/value/array.rs index e372d9ad5..77accd0f6 100644 --- a/noodles-bcf/src/record/codec/value/array.rs +++ b/noodles-bcf/src/record/codec/value/array.rs @@ -11,7 +11,7 @@ pub enum Array<'a> { Float(Box + 'a>), } -impl<'a> fmt::Debug for Array<'a> { +impl fmt::Debug for Array<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Int8(values) => f.debug_list().entries(values.iter()).finish(), diff --git a/noodles-bcf/src/record/codec/value/array/values.rs b/noodles-bcf/src/record/codec/value/array/values.rs index dd9940eae..025e887d9 100644 --- a/noodles-bcf/src/record/codec/value/array/values.rs +++ b/noodles-bcf/src/record/codec/value/array/values.rs @@ -5,7 +5,7 @@ pub trait Values<'a, N> { fn iter(&self) -> Box> + '_>; } -impl<'a, N> Values<'a, N> for Vec +impl Values<'_, N> for Vec where N: Copy, { diff --git a/noodles-bcf/src/record/filters.rs b/noodles-bcf/src/record/filters.rs index d8b75c381..44d5c4fad 100644 --- a/noodles-bcf/src/record/filters.rs +++ b/noodles-bcf/src/record/filters.rs @@ -42,13 +42,13 @@ impl<'r> Filters<'r> { } } -impl<'r> AsRef<[u8]> for Filters<'r> { +impl AsRef<[u8]> for Filters<'_> { fn as_ref(&self) -> &[u8] { self.0 } } -impl<'r> vcf::variant::record::Filters for Filters<'r> { +impl vcf::variant::record::Filters for Filters<'_> { fn is_empty(&self) -> bool { self.len() == 0 } diff --git a/noodles-bcf/src/record/ids.rs b/noodles-bcf/src/record/ids.rs index 54f9835f5..09c91cf2d 100644 --- a/noodles-bcf/src/record/ids.rs +++ b/noodles-bcf/src/record/ids.rs @@ -12,13 +12,13 @@ impl<'a> Ids<'a> { } } -impl<'a> AsRef<[u8]> for Ids<'a> { +impl AsRef<[u8]> for Ids<'_> { fn as_ref(&self) -> &[u8] { self.0 } } -impl<'a> vcf::variant::record::Ids for Ids<'a> { +impl vcf::variant::record::Ids for Ids<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-bcf/src/record/info.rs b/noodles-bcf/src/record/info.rs index 1dfb1e986..25fd97be9 100644 --- a/noodles-bcf/src/record/info.rs +++ b/noodles-bcf/src/record/info.rs @@ -42,13 +42,13 @@ impl<'r> Info<'r> { } } -impl<'r> AsRef<[u8]> for Info<'r> { +impl AsRef<[u8]> for Info<'_> { fn as_ref(&self) -> &[u8] { self.src } } -impl<'r> vcf::variant::record::Info for Info<'r> { +impl vcf::variant::record::Info for Info<'_> { fn is_empty(&self) -> bool { self.len() == 0 } diff --git a/noodles-bcf/src/record/info/field/value.rs b/noodles-bcf/src/record/info/field/value.rs index 304791749..ed71e1e60 100644 --- a/noodles-bcf/src/record/info/field/value.rs +++ b/noodles-bcf/src/record/info/field/value.rs @@ -64,7 +64,7 @@ impl Once { } } -impl<'a, T> vcf::variant::record::info::field::value::array::Values<'a, T> for Once +impl vcf::variant::record::info::field::value::array::Values<'_, T> for Once where T: Copy, { diff --git a/noodles-bcf/src/record/reference_bases.rs b/noodles-bcf/src/record/reference_bases.rs index ac58ae506..1cc6c8b5f 100644 --- a/noodles-bcf/src/record/reference_bases.rs +++ b/noodles-bcf/src/record/reference_bases.rs @@ -12,13 +12,13 @@ impl<'a> ReferenceBases<'a> { } } -impl<'a> AsRef<[u8]> for ReferenceBases<'a> { +impl AsRef<[u8]> for ReferenceBases<'_> { fn as_ref(&self) -> &[u8] { self.0 } } -impl<'a> vcf::variant::record::ReferenceBases for ReferenceBases<'a> { +impl vcf::variant::record::ReferenceBases for ReferenceBases<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-bcf/src/record/samples.rs b/noodles-bcf/src/record/samples.rs index 6188334e9..2a3ac8d51 100644 --- a/noodles-bcf/src/record/samples.rs +++ b/noodles-bcf/src/record/samples.rs @@ -98,13 +98,13 @@ impl<'r> Samples<'r> { } } -impl<'r> AsRef<[u8]> for Samples<'r> { +impl AsRef<[u8]> for Samples<'_> { fn as_ref(&self) -> &[u8] { self.src } } -impl<'r> vcf::variant::record::Samples for Samples<'r> { +impl vcf::variant::record::Samples for Samples<'_> { fn is_empty(&self) -> bool { self.len() == 0 } diff --git a/noodles-bcf/src/record/samples/sample.rs b/noodles-bcf/src/record/samples/sample.rs index bcb92a089..9b37d582c 100644 --- a/noodles-bcf/src/record/samples/sample.rs +++ b/noodles-bcf/src/record/samples/sample.rs @@ -16,7 +16,7 @@ impl<'r> Sample<'r> { } } -impl<'r> vcf::variant::record::samples::Sample for Sample<'r> { +impl vcf::variant::record::samples::Sample for Sample<'_> { fn get<'a, 'h: 'a>( &'a self, header: &'h vcf::Header, diff --git a/noodles-bcf/src/record/samples/series.rs b/noodles-bcf/src/record/samples/series.rs index 893fc7a1d..c5e44c95f 100644 --- a/noodles-bcf/src/record/samples/series.rs +++ b/noodles-bcf/src/record/samples/series.rs @@ -113,7 +113,7 @@ impl<'r> Series<'r> { } } -impl<'r> vcf::variant::record::samples::Series for Series<'r> { +impl vcf::variant::record::samples::Series for Series<'_> { fn name<'a, 'h: 'a>(&'a self, header: &'h vcf::Header) -> io::Result<&'a str> { header .string_maps() diff --git a/noodles-bcf/src/record/value.rs b/noodles-bcf/src/record/value.rs index 183360d99..baeff8e27 100644 --- a/noodles-bcf/src/record/value.rs +++ b/noodles-bcf/src/record/value.rs @@ -16,7 +16,7 @@ pub(crate) enum Value<'a> { Array(Array<'a>), } -impl<'a> Value<'a> { +impl Value<'_> { pub(crate) fn as_int(&self) -> Option { match self { Self::Int8(Some(Int8::Value(n))) => Some(i32::from(*n)), diff --git a/noodles-bcf/src/record/value/array/values.rs b/noodles-bcf/src/record/value/array/values.rs index b0eceb92d..480c6ae48 100644 --- a/noodles-bcf/src/record/value/array/values.rs +++ b/noodles-bcf/src/record/value/array/values.rs @@ -18,13 +18,13 @@ impl<'a, N> Values<'a, N> { } } -impl<'a, N> AsRef<[u8]> for Values<'a, N> { +impl AsRef<[u8]> for Values<'_, N> { fn as_ref(&self) -> &[u8] { self.src } } -impl<'a> Values<'a, i8> { +impl Values<'_, i8> { pub(crate) fn iter(&self) -> impl Iterator + '_ { self.src.iter().map(|&n| Int8::from(n as i8)) } @@ -59,7 +59,7 @@ impl<'a> vcf::variant::record::samples::series::value::array::Values<'a, i32> fo } } -impl<'a> Values<'a, i16> { +impl Values<'_, i16> { pub(crate) fn iter(&self) -> impl Iterator + '_ { self.src.chunks_exact(mem::size_of::()).map(|chunk| { // SAFETY: `chunk` is 2 bytes. @@ -98,7 +98,7 @@ impl<'a> vcf::variant::record::samples::series::value::array::Values<'a, i32> fo } } -impl<'a> Values<'a, i32> { +impl Values<'_, i32> { pub(crate) fn iter(&self) -> impl Iterator + '_ { self.src.chunks_exact(mem::size_of::()).map(|chunk| { // SAFETY: `chunk` is 4 bytes. @@ -137,7 +137,7 @@ impl<'a> vcf::variant::record::samples::series::value::array::Values<'a, i32> fo } } -impl<'a> Values<'a, f32> { +impl Values<'_, f32> { pub(crate) fn iter(&self) -> impl Iterator + '_ { self.src.chunks_exact(mem::size_of::()).map(|chunk| { // SAFETY: `chunk` is 4 bytes. diff --git a/noodles-bed/src/record/other_fields.rs b/noodles-bed/src/record/other_fields.rs index 78068bfa5..9b9f5f93b 100644 --- a/noodles-bed/src/record/other_fields.rs +++ b/noodles-bed/src/record/other_fields.rs @@ -41,13 +41,13 @@ impl<'a, const N: usize> OtherFields<'a, N> { } } -impl<'a, const N: usize> fmt::Debug for OtherFields<'a, N> { +impl fmt::Debug for OtherFields<'_, N> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.iter()).finish() } } -impl<'a, const N: usize> crate::feature::record::OtherFields for OtherFields<'a, N> { +impl crate::feature::record::OtherFields for OtherFields<'_, N> { fn is_empty(&self) -> bool { self.is_empty() } diff --git a/noodles-bgzf/src/async/reader.rs b/noodles-bgzf/src/async/reader.rs index 482d4e21a..b28cd586a 100644 --- a/noodles-bgzf/src/async/reader.rs +++ b/noodles-bgzf/src/async/reader.rs @@ -260,7 +260,7 @@ where } } - return Poll::Ready(Ok(this.block.data().as_ref())); + Poll::Ready(Ok(this.block.data().as_ref())) } fn consume(self: Pin<&mut Self>, amt: usize) { diff --git a/noodles-cram/src/crai/async.rs b/noodles-cram/src/crai/async.rs index c70301bc4..a9b317a54 100644 --- a/noodles-cram/src/crai/async.rs +++ b/noodles-cram/src/crai/async.rs @@ -54,7 +54,6 @@ where /// # Ok(()) /// # } /// ``` - pub async fn write

(dst: P, index: &[Record]) -> io::Result<()> where P: AsRef, diff --git a/noodles-cram/src/data_container/compression_header/encoding/codec/byte.rs b/noodles-cram/src/data_container/compression_header/encoding/codec/byte.rs index 086ea4226..579dc8181 100644 --- a/noodles-cram/src/data_container/compression_header/encoding/codec/byte.rs +++ b/noodles-cram/src/data_container/compression_header/encoding/codec/byte.rs @@ -97,7 +97,7 @@ impl Decode for Byte { } } -impl<'en> Encode<'en> for Byte { +impl Encode<'_> for Byte { type Value = u8; fn encode( diff --git a/noodles-cram/src/data_container/compression_header/encoding/codec/integer.rs b/noodles-cram/src/data_container/compression_header/encoding/codec/integer.rs index 57ef6dec3..7410accd5 100644 --- a/noodles-cram/src/data_container/compression_header/encoding/codec/integer.rs +++ b/noodles-cram/src/data_container/compression_header/encoding/codec/integer.rs @@ -99,7 +99,7 @@ impl Decode for Integer { } } -impl<'en> Encode<'en> for Integer { +impl Encode<'_> for Integer { type Value = i32; fn encode( diff --git a/noodles-cram/src/io/reader.rs b/noodles-cram/src/io/reader.rs index 54374691d..227e295c5 100644 --- a/noodles-cram/src/io/reader.rs +++ b/noodles-cram/src/io/reader.rs @@ -305,7 +305,7 @@ where header: &'a sam::Header, index: &'a crai::Index, region: &Region, - ) -> io::Result> { + ) -> io::Result> { let reference_sequence_id = header .reference_sequences() .get_index_of(region.name()) diff --git a/noodles-cram/src/io/reader/query.rs b/noodles-cram/src/io/reader/query.rs index 816453bb5..3a04e92cb 100644 --- a/noodles-cram/src/io/reader/query.rs +++ b/noodles-cram/src/io/reader/query.rs @@ -104,7 +104,7 @@ where } } -impl<'a, R> Iterator for Query<'a, R> +impl Iterator for Query<'_, R> where R: Read + Seek, { diff --git a/noodles-cram/src/io/reader/records.rs b/noodles-cram/src/io/reader/records.rs index 03a3694f6..79c816993 100644 --- a/noodles-cram/src/io/reader/records.rs +++ b/noodles-cram/src/io/reader/records.rs @@ -64,7 +64,7 @@ where } } -impl<'a, R> Iterator for Records<'a, R> +impl Iterator for Records<'_, R> where R: Read, { diff --git a/noodles-cram/src/record.rs b/noodles-cram/src/record.rs index b46fffdb0..250106815 100644 --- a/noodles-cram/src/record.rs +++ b/noodles-cram/src/record.rs @@ -246,7 +246,7 @@ impl<'a> Cigar<'a> { } } -impl<'a> sam::alignment::record::Cigar for Cigar<'a> { +impl sam::alignment::record::Cigar for Cigar<'_> { fn is_empty(&self) -> bool { self.is_unmapped } diff --git a/noodles-cram/src/record/features/cigar.rs b/noodles-cram/src/record/features/cigar.rs index 5d51115d4..534a4e9c8 100644 --- a/noodles-cram/src/record/features/cigar.rs +++ b/noodles-cram/src/record/features/cigar.rs @@ -31,7 +31,7 @@ impl<'a> Cigar<'a> { } } -impl<'a> Iterator for Cigar<'a> { +impl Iterator for Cigar<'_> { type Item = Op; fn next(&mut self) -> Option { diff --git a/noodles-csi/src/io/filter_by_region.rs b/noodles-csi/src/io/filter_by_region.rs index 5f76638d0..58764ccbd 100644 --- a/noodles-csi/src/io/filter_by_region.rs +++ b/noodles-csi/src/io/filter_by_region.rs @@ -25,7 +25,7 @@ where } } -impl<'r, I, R> Iterator for FilterByRegion<'r, I, R> +impl Iterator for FilterByRegion<'_, I, R> where I: Iterator>, R: IndexedRecord, @@ -59,22 +59,22 @@ mod tests { use super::*; use noodles_core::Position; - #[test] - fn test_next() -> Result<(), Box> { - impl IndexedRecord for (&str, Position, Position) { - fn indexed_reference_sequence_name(&self) -> &str { - self.0 - } + impl IndexedRecord for (&str, Position, Position) { + fn indexed_reference_sequence_name(&self) -> &str { + self.0 + } - fn indexed_start_position(&self) -> Position { - self.1 - } + fn indexed_start_position(&self) -> Position { + self.1 + } - fn indexed_end_position(&self) -> Position { - self.2 - } + fn indexed_end_position(&self) -> Position { + self.2 } + } + #[test] + fn test_next() -> Result<(), Box> { let records = [ Ok(("sq0", Position::try_from(5)?, Position::try_from(13)?)), Ok(("sq1", Position::try_from(5)?, Position::try_from(13)?)), diff --git a/noodles-csi/src/io/query.rs b/noodles-csi/src/io/query.rs index 2711339cd..9afc85d91 100644 --- a/noodles-csi/src/io/query.rs +++ b/noodles-csi/src/io/query.rs @@ -34,7 +34,7 @@ impl<'r, R> Query<'r, R> { } } -impl<'r, R> Query<'r, R> +impl Query<'_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { @@ -44,7 +44,7 @@ where } } -impl<'r, R> Read for Query<'r, R> +impl Read for Query<'_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { @@ -56,7 +56,7 @@ where } } -impl<'r, R> BufRead for Query<'r, R> +impl BufRead for Query<'_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { diff --git a/noodles-fasta/src/io/reader/records.rs b/noodles-fasta/src/io/reader/records.rs index f63a42e64..0a3d419bc 100644 --- a/noodles-fasta/src/io/reader/records.rs +++ b/noodles-fasta/src/io/reader/records.rs @@ -24,7 +24,7 @@ where } } -impl<'a, R> Iterator for Records<'a, R> +impl Iterator for Records<'_, R> where R: BufRead, { diff --git a/noodles-fasta/src/io/reader/sequence.rs b/noodles-fasta/src/io/reader/sequence.rs index d0ca151a6..cbbf72b52 100644 --- a/noodles-fasta/src/io/reader/sequence.rs +++ b/noodles-fasta/src/io/reader/sequence.rs @@ -26,7 +26,7 @@ where } } -impl<'r, R> Read for Reader<'r, R> +impl Read for Reader<'_, R> where R: BufRead, { @@ -38,7 +38,7 @@ where } } -impl<'r, R> BufRead for Reader<'r, R> +impl BufRead for Reader<'_, R> where R: BufRead, { diff --git a/noodles-fasta/src/record/sequence/complement.rs b/noodles-fasta/src/record/sequence/complement.rs index b7c18c857..21e54a08f 100644 --- a/noodles-fasta/src/record/sequence/complement.rs +++ b/noodles-fasta/src/record/sequence/complement.rs @@ -28,7 +28,7 @@ impl fmt::Display for ComplementError { } } -impl<'a> Iterator for Complement<'a> { +impl Iterator for Complement<'_> { type Item = Result; fn next(&mut self) -> Option { @@ -36,15 +36,15 @@ impl<'a> Iterator for Complement<'a> { } } -impl<'a> DoubleEndedIterator for Complement<'a> { +impl DoubleEndedIterator for Complement<'_> { fn next_back(&mut self) -> Option { self.iter.next_back().copied().map(complement) } } -impl<'a> ExactSizeIterator for Complement<'a> {} +impl ExactSizeIterator for Complement<'_> {} -impl<'a> FusedIterator for Complement<'a> {} +impl FusedIterator for Complement<'_> {} fn complement(b: u8) -> Result { match b { diff --git a/noodles-fastq/src/io/reader/records.rs b/noodles-fastq/src/io/reader/records.rs index ed0d422ad..8aafed24d 100644 --- a/noodles-fastq/src/io/reader/records.rs +++ b/noodles-fastq/src/io/reader/records.rs @@ -24,7 +24,7 @@ where } } -impl<'a, R> Iterator for Records<'a, R> +impl Iterator for Records<'_, R> where R: BufRead, { diff --git a/noodles-gff/src/directive.rs b/noodles-gff/src/directive.rs index af958b2f5..073eaf0c8 100644 --- a/noodles-gff/src/directive.rs +++ b/noodles-gff/src/directive.rs @@ -24,7 +24,7 @@ impl<'l> Directive<'l> { } } -impl<'l> AsRef for Directive<'l> { +impl AsRef for Directive<'_> { fn as_ref(&self) -> &str { self.src } diff --git a/noodles-gff/src/io/reader/line_bufs.rs b/noodles-gff/src/io/reader/line_bufs.rs index badbec4b7..2f89537e7 100644 --- a/noodles-gff/src/io/reader/line_bufs.rs +++ b/noodles-gff/src/io/reader/line_bufs.rs @@ -27,7 +27,7 @@ where } } -impl<'a, R> Iterator for LineBufs<'a, R> +impl Iterator for LineBufs<'_, R> where R: BufRead, { diff --git a/noodles-gff/src/io/reader/record_bufs.rs b/noodles-gff/src/io/reader/record_bufs.rs index 7bb8b1beb..edbc5c94d 100644 --- a/noodles-gff/src/io/reader/record_bufs.rs +++ b/noodles-gff/src/io/reader/record_bufs.rs @@ -23,7 +23,7 @@ where } } -impl<'a, R> Iterator for RecordBufs<'a, R> +impl Iterator for RecordBufs<'_, R> where R: BufRead, { diff --git a/noodles-gff/src/record.rs b/noodles-gff/src/record.rs index 2954df9f7..eaa197c1c 100644 --- a/noodles-gff/src/record.rs +++ b/noodles-gff/src/record.rs @@ -69,7 +69,7 @@ impl<'l> Record<'l> { } } -impl<'l> fmt::Debug for Record<'l> { +impl fmt::Debug for Record<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Record") .field("reference_sequence_name", &self.reference_sequence_name()) diff --git a/noodles-gff/src/record/attributes.rs b/noodles-gff/src/record/attributes.rs index 847ae4f39..fc04f8840 100644 --- a/noodles-gff/src/record/attributes.rs +++ b/noodles-gff/src/record/attributes.rs @@ -49,13 +49,13 @@ impl<'a> Attributes<'a> { } } -impl<'a> AsRef for Attributes<'a> { +impl AsRef for Attributes<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'a> fmt::Debug for Attributes<'a> { +impl fmt::Debug for Attributes<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut formatter = f.debug_map(); diff --git a/noodles-gff/src/record/attributes/field/value.rs b/noodles-gff/src/record/attributes/field/value.rs index bded9e586..5fe1336ab 100644 --- a/noodles-gff/src/record/attributes/field/value.rs +++ b/noodles-gff/src/record/attributes/field/value.rs @@ -14,7 +14,7 @@ pub enum Value<'a> { Array(Array<'a>), } -impl<'a> AsRef for Value<'a> { +impl AsRef for Value<'_> { fn as_ref(&self) -> &str { match self { Value::String(s) => s, diff --git a/noodles-gff/src/record/attributes/field/value/array.rs b/noodles-gff/src/record/attributes/field/value/array.rs index a6b855ef9..35ed41e28 100644 --- a/noodles-gff/src/record/attributes/field/value/array.rs +++ b/noodles-gff/src/record/attributes/field/value/array.rs @@ -21,13 +21,13 @@ impl<'a> Array<'a> { } } -impl<'a> AsRef for Array<'a> { +impl AsRef for Array<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'a> fmt::Debug for Array<'a> { +impl fmt::Debug for Array<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.iter()).finish() } diff --git a/noodles-htsget/src/request/payload/regions.rs b/noodles-htsget/src/request/payload/regions.rs index 9d66f07d1..8426241fb 100644 --- a/noodles-htsget/src/request/payload/regions.rs +++ b/noodles-htsget/src/request/payload/regions.rs @@ -32,7 +32,7 @@ impl Serialize for Regions { struct HtsgetRegion<'a>(&'a Region); -impl<'a> Serialize for HtsgetRegion<'a> { +impl Serialize for HtsgetRegion<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/noodles-sam/src/alignment/record/data/field/value.rs b/noodles-sam/src/alignment/record/data/field/value.rs index daceebecc..643bebd79 100644 --- a/noodles-sam/src/alignment/record/data/field/value.rs +++ b/noodles-sam/src/alignment/record/data/field/value.rs @@ -36,7 +36,7 @@ pub enum Value<'a> { Array(Array<'a>), } -impl<'a> Value<'a> { +impl Value<'_> { /// Return the type of the value. /// /// # Examples diff --git a/noodles-sam/src/alignment/record/data/field/value/array.rs b/noodles-sam/src/alignment/record/data/field/value/array.rs index cf7335029..20c6040ee 100644 --- a/noodles-sam/src/alignment/record/data/field/value/array.rs +++ b/noodles-sam/src/alignment/record/data/field/value/array.rs @@ -25,7 +25,7 @@ pub enum Array<'a> { Float(Box + 'a>), } -impl<'a> Array<'a> { +impl Array<'_> { /// Returns the array value type. pub fn subtype(&self) -> Subtype { match self { @@ -40,7 +40,7 @@ impl<'a> Array<'a> { } } -impl<'a> fmt::Debug for Array<'a> { +impl fmt::Debug for Array<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Int8(values) => f.debug_list().entries(values.iter()).finish(), diff --git a/noodles-sam/src/io/reader/query.rs b/noodles-sam/src/io/reader/query.rs index ac4728997..ea6c63ebd 100644 --- a/noodles-sam/src/io/reader/query.rs +++ b/noodles-sam/src/io/reader/query.rs @@ -36,7 +36,7 @@ where } } -impl<'r, 'h, R> Iterator for Query<'r, 'h, R> +impl Iterator for Query<'_, '_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { diff --git a/noodles-sam/src/io/reader/record_bufs.rs b/noodles-sam/src/io/reader/record_bufs.rs index 349a1a9c6..144179a5f 100644 --- a/noodles-sam/src/io/reader/record_bufs.rs +++ b/noodles-sam/src/io/reader/record_bufs.rs @@ -25,7 +25,7 @@ where } } -impl<'a, R> Iterator for RecordBufs<'a, R> +impl Iterator for RecordBufs<'_, R> where R: BufRead, { diff --git a/noodles-sam/src/record/cigar.rs b/noodles-sam/src/record/cigar.rs index f91a9c744..61986ac4d 100644 --- a/noodles-sam/src/record/cigar.rs +++ b/noodles-sam/src/record/cigar.rs @@ -71,13 +71,13 @@ impl<'a> Cigar<'a> { } } -impl<'a> fmt::Debug for Cigar<'a> { +impl fmt::Debug for Cigar<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.iter()).finish() } } -impl<'a> crate::alignment::record::Cigar for Cigar<'a> { +impl crate::alignment::record::Cigar for Cigar<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -103,7 +103,7 @@ impl<'a> crate::alignment::record::Cigar for Cigar<'a> { } } -impl<'a> AsRef<[u8]> for Cigar<'a> { +impl AsRef<[u8]> for Cigar<'_> { fn as_ref(&self) -> &[u8] { self.0 } diff --git a/noodles-sam/src/record/data.rs b/noodles-sam/src/record/data.rs index 1169dc76f..8d37db96d 100644 --- a/noodles-sam/src/record/data.rs +++ b/noodles-sam/src/record/data.rs @@ -34,7 +34,7 @@ impl<'a> Data<'a> { } } -impl<'a> fmt::Debug for Data<'a> { +impl fmt::Debug for Data<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut formatter = f.debug_map(); @@ -47,7 +47,7 @@ impl<'a> fmt::Debug for Data<'a> { } } -impl<'a> crate::alignment::record::Data for Data<'a> { +impl crate::alignment::record::Data for Data<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -72,7 +72,7 @@ impl<'a> crate::alignment::record::Data for Data<'a> { } } -impl<'a> AsRef<[u8]> for Data<'a> { +impl AsRef<[u8]> for Data<'_> { fn as_ref(&self) -> &[u8] { self.0 } diff --git a/noodles-sam/src/record/quality_scores.rs b/noodles-sam/src/record/quality_scores.rs index 76769506d..1c8b36a32 100644 --- a/noodles-sam/src/record/quality_scores.rs +++ b/noodles-sam/src/record/quality_scores.rs @@ -50,7 +50,7 @@ impl<'a> QualityScores<'a> { } } -impl<'a> crate::alignment::record::QualityScores for QualityScores<'a> { +impl crate::alignment::record::QualityScores for QualityScores<'_> { fn is_empty(&self) -> bool { self.is_empty() } @@ -69,7 +69,7 @@ impl<'a> crate::alignment::record::QualityScores for QualityScores<'a> { } } -impl<'a> AsRef<[u8]> for QualityScores<'a> { +impl AsRef<[u8]> for QualityScores<'_> { fn as_ref(&self) -> &[u8] { self.0 } diff --git a/noodles-sam/src/record/sequence.rs b/noodles-sam/src/record/sequence.rs index 7ac5e727e..254a561ed 100644 --- a/noodles-sam/src/record/sequence.rs +++ b/noodles-sam/src/record/sequence.rs @@ -23,13 +23,13 @@ impl<'a> Sequence<'a> { } } -impl<'a> AsRef<[u8]> for Sequence<'a> { +impl AsRef<[u8]> for Sequence<'_> { fn as_ref(&self) -> &[u8] { self.0 } } -impl<'a> crate::alignment::record::Sequence for Sequence<'a> { +impl crate::alignment::record::Sequence for Sequence<'_> { fn is_empty(&self) -> bool { self.is_empty() } diff --git a/noodles-util/src/alignment/iter/pileup.rs b/noodles-util/src/alignment/iter/pileup.rs index 29e7ad1f8..df4e6d173 100644 --- a/noodles-util/src/alignment/iter/pileup.rs +++ b/noodles-util/src/alignment/iter/pileup.rs @@ -125,7 +125,7 @@ where } } -impl<'a, I> Iterator for Pileup<'a, I> +impl Iterator for Pileup<'_, I> where I: Iterator>>, { diff --git a/noodles-util/src/variant/io/indexed_reader.rs b/noodles-util/src/variant/io/indexed_reader.rs index ae76aef2e..daadeae57 100644 --- a/noodles-util/src/variant/io/indexed_reader.rs +++ b/noodles-util/src/variant/io/indexed_reader.rs @@ -32,9 +32,7 @@ where } /// Returns an iterator over records starting from the current stream position. - pub fn records<'r, 'h: 'r>( - &'r mut self, - ) -> impl Iterator>> + '_ { + pub fn records(&mut self) -> impl Iterator>> + '_ { let records: Box>>> = match self { Self::Vcf(reader) => Box::new( reader @@ -61,7 +59,7 @@ where &'r mut self, header: &'h vcf::Header, region: &Region, - ) -> io::Result>> + '_> { + ) -> io::Result>> + 'r> { let records: Box>>> = match self { Self::Vcf(reader) => Box::new( reader diff --git a/noodles-vcf/src/io/reader/query.rs b/noodles-vcf/src/io/reader/query.rs index 194493e52..711fe1743 100644 --- a/noodles-vcf/src/io/reader/query.rs +++ b/noodles-vcf/src/io/reader/query.rs @@ -39,7 +39,7 @@ where } } -impl<'r, 'h, R> Iterator for Query<'r, 'h, R> +impl Iterator for Query<'_, '_, R> where R: bgzf::io::BufRead + bgzf::io::Seek, { diff --git a/noodles-vcf/src/io/reader/record_bufs.rs b/noodles-vcf/src/io/reader/record_bufs.rs index 3e72ac78f..bec49d807 100644 --- a/noodles-vcf/src/io/reader/record_bufs.rs +++ b/noodles-vcf/src/io/reader/record_bufs.rs @@ -25,7 +25,7 @@ where } } -impl<'r, 'h, R> Iterator for RecordBufs<'r, 'h, R> +impl Iterator for RecordBufs<'_, '_, R> where R: BufRead, { diff --git a/noodles-vcf/src/record/alternate_bases.rs b/noodles-vcf/src/record/alternate_bases.rs index 2cdd03a1a..0ecbbc021 100644 --- a/noodles-vcf/src/record/alternate_bases.rs +++ b/noodles-vcf/src/record/alternate_bases.rs @@ -13,19 +13,19 @@ impl<'a> AlternateBases<'a> { } } -impl<'a> fmt::Debug for AlternateBases<'a> { +impl fmt::Debug for AlternateBases<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.iter()).finish() } } -impl<'a> AsRef for AlternateBases<'a> { +impl AsRef for AlternateBases<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'a> crate::variant::record::AlternateBases for AlternateBases<'a> { +impl crate::variant::record::AlternateBases for AlternateBases<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-vcf/src/record/filters.rs b/noodles-vcf/src/record/filters.rs index b527b921d..73221ce43 100644 --- a/noodles-vcf/src/record/filters.rs +++ b/noodles-vcf/src/record/filters.rs @@ -12,13 +12,13 @@ impl<'r> Filters<'r> { } } -impl<'r> AsRef for Filters<'r> { +impl AsRef for Filters<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'r> crate::variant::record::Filters for Filters<'r> { +impl crate::variant::record::Filters for Filters<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-vcf/src/record/ids.rs b/noodles-vcf/src/record/ids.rs index 9225f5d28..70eedb63b 100644 --- a/noodles-vcf/src/record/ids.rs +++ b/noodles-vcf/src/record/ids.rs @@ -10,13 +10,13 @@ impl<'a> Ids<'a> { } } -impl<'a> AsRef for Ids<'a> { +impl AsRef for Ids<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'a> crate::variant::record::Ids for Ids<'a> { +impl crate::variant::record::Ids for Ids<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-vcf/src/record/info.rs b/noodles-vcf/src/record/info.rs index 62a3ca50f..0f9f93a6a 100644 --- a/noodles-vcf/src/record/info.rs +++ b/noodles-vcf/src/record/info.rs @@ -51,13 +51,13 @@ impl<'r> Info<'r> { } } -impl<'r> AsRef for Info<'r> { +impl AsRef for Info<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'r> crate::variant::record::Info for Info<'r> { +impl crate::variant::record::Info for Info<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-vcf/src/record/samples.rs b/noodles-vcf/src/record/samples.rs index d74895ef8..e580f276c 100644 --- a/noodles-vcf/src/record/samples.rs +++ b/noodles-vcf/src/record/samples.rs @@ -54,7 +54,7 @@ impl<'r> Samples<'r> { } /// Returns an iterator over series. - pub fn series(&'r self) -> impl Iterator> + '_ { + pub fn series(&'r self) -> impl Iterator> + 'r { self.keys() .iter() .enumerate() @@ -75,13 +75,13 @@ impl<'r> Samples<'r> { } } -impl<'a> AsRef for Samples<'a> { +impl AsRef for Samples<'_> { fn as_ref(&self) -> &str { self.0 } } -impl<'r> crate::variant::record::Samples for Samples<'r> { +impl crate::variant::record::Samples for Samples<'_> { fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/noodles-vcf/src/record/samples/sample.rs b/noodles-vcf/src/record/samples/sample.rs index 9df1e5c71..0bd0d32a3 100644 --- a/noodles-vcf/src/record/samples/sample.rs +++ b/noodles-vcf/src/record/samples/sample.rs @@ -53,13 +53,13 @@ impl<'s> Sample<'s> { } } -impl<'a> AsRef for Sample<'a> { +impl AsRef for Sample<'_> { fn as_ref(&self) -> &str { self.src } } -impl<'r> crate::variant::record::samples::Sample for Sample<'r> { +impl crate::variant::record::samples::Sample for Sample<'_> { fn get<'a, 'h: 'a>( &'a self, header: &'h Header, @@ -92,7 +92,7 @@ impl<'r> crate::variant::record::samples::Sample for Sample<'r> { fn iter<'a, 'h: 'a>( &'a self, header: &'h Header, - ) -> Box>)>> + 'a> { + ) -> Box>)>> + 'a> { Box::new(self.iter(header)) } } diff --git a/noodles-vcf/src/record/samples/series.rs b/noodles-vcf/src/record/samples/series.rs index 34bb38392..4ee2f56c1 100644 --- a/noodles-vcf/src/record/samples/series.rs +++ b/noodles-vcf/src/record/samples/series.rs @@ -20,7 +20,7 @@ impl<'r> Series<'r> { } } -impl<'r> crate::variant::record::samples::Series for Series<'r> { +impl crate::variant::record::samples::Series for Series<'_> { fn name<'a, 'h: 'a>(&'a self, _: &'h Header) -> io::Result<&'a str> { Ok(self.name) } diff --git a/noodles-vcf/src/record/samples/series/value/genotype.rs b/noodles-vcf/src/record/samples/series/value/genotype.rs index ad4f413f1..1d720ab20 100644 --- a/noodles-vcf/src/record/samples/series/value/genotype.rs +++ b/noodles-vcf/src/record/samples/series/value/genotype.rs @@ -12,7 +12,7 @@ impl<'a> Genotype<'a> { } } -impl<'a> crate::variant::record::samples::series::value::Genotype for Genotype<'a> { +impl crate::variant::record::samples::series::value::Genotype for Genotype<'_> { fn iter(&self) -> Box, Phasing)>> + '_> { let mut src = self.0; diff --git a/noodles-vcf/src/variant/record/info/field/value/array.rs b/noodles-vcf/src/variant/record/info/field/value/array.rs index af58f6c13..53c4b0e69 100644 --- a/noodles-vcf/src/variant/record/info/field/value/array.rs +++ b/noodles-vcf/src/variant/record/info/field/value/array.rs @@ -18,7 +18,7 @@ pub enum Array<'a> { String(Box> + 'a>), } -impl<'a> fmt::Debug for Array<'a> { +impl fmt::Debug for Array<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Integer(values) => f.debug_list().entries(values.iter()).finish(), diff --git a/noodles-vcf/src/variant/record/samples/series/value/array.rs b/noodles-vcf/src/variant/record/samples/series/value/array.rs index 59a3d448b..1e5c8a981 100644 --- a/noodles-vcf/src/variant/record/samples/series/value/array.rs +++ b/noodles-vcf/src/variant/record/samples/series/value/array.rs @@ -18,7 +18,7 @@ pub enum Array<'a> { String(Box> + 'a>), } -impl<'a> fmt::Debug for Array<'a> { +impl fmt::Debug for Array<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Integer(values) => f.debug_list().entries(values.iter()).finish(), diff --git a/noodles-vcf/src/variant/record_buf/samples/sample.rs b/noodles-vcf/src/variant/record_buf/samples/sample.rs index ceb1f859b..ea96cbd6c 100644 --- a/noodles-vcf/src/variant/record_buf/samples/sample.rs +++ b/noodles-vcf/src/variant/record_buf/samples/sample.rs @@ -43,7 +43,7 @@ impl<'g> Sample<'g> { } } -impl<'g> crate::variant::record::samples::Sample for Sample<'g> { +impl crate::variant::record::samples::Sample for Sample<'_> { fn get<'a, 'h: 'a>( &'a self, header: &'h Header, @@ -71,7 +71,7 @@ impl<'g> crate::variant::record::samples::Sample for Sample<'g> { ) -> Box< dyn Iterator< Item = io::Result<( - &str, + &'a str, Option>, )>, > + 'a, diff --git a/noodles-vcf/src/variant/record_buf/samples/series.rs b/noodles-vcf/src/variant/record_buf/samples/series.rs index 0226c2e59..d0aa06968 100644 --- a/noodles-vcf/src/variant/record_buf/samples/series.rs +++ b/noodles-vcf/src/variant/record_buf/samples/series.rs @@ -23,7 +23,7 @@ impl<'s> Series<'s> { } } -impl<'s> crate::variant::record::samples::Series for Series<'s> { +impl crate::variant::record::samples::Series for Series<'_> { fn name<'a, 'h: 'a>(&'a self, _: &'h Header) -> io::Result<&'a str> { Ok(self.name) }