From deb9c323728ce380c2d2b2d558edb70725905dca Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 6 Oct 2023 22:21:09 -0400 Subject: [PATCH] Ignore into_iter_without_iter pedantic clippy lint warning: `IntoIterator` implemented for a reference type without an `iter` method --> src/bytes.rs:137:1 | 137 | / impl<'a> IntoIterator for &'a Bytes { 138 | | type Item = &'a u8; 139 | | type IntoIter = <&'a [u8] as IntoIterator>::IntoIter; 140 | | ... | 143 | | } 144 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter = note: `-W clippy::into-iter-without-iter` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::into_iter_without_iter)]` help: consider implementing `iter` | 137 + 138 + impl Bytes { 139 + fn iter(&self) -> <&'a [u8] as IntoIterator>::IntoIter { 140 + <&Self as IntoIterator>::into_iter(self) 141 + } 142 + } | warning: `IntoIterator` implemented for a reference type without an `iter_mut` method --> src/bytes.rs:146:1 | 146 | / impl<'a> IntoIterator for &'a mut Bytes { 147 | | type Item = &'a mut u8; 148 | | type IntoIter = <&'a mut [u8] as IntoIterator>::IntoIter; 149 | | ... | 152 | | } 153 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter help: consider implementing `iter_mut` | 146 + 147 + impl Bytes { 148 + fn iter_mut(&mut self) -> <&'a mut [u8] as IntoIterator>::IntoIter { 149 + <&mut Self as IntoIterator>::into_iter(self) 150 + } 151 + } | warning: `IntoIterator` implemented for a reference type without an `iter` method --> src/bytebuf.rs:167:1 | 167 | / impl<'a> IntoIterator for &'a ByteBuf { 168 | | type Item = &'a u8; 169 | | type IntoIter = <&'a [u8] as IntoIterator>::IntoIter; 170 | | ... | 173 | | } 174 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter help: consider implementing `iter` | 167 + 168 + impl ByteBuf { 169 + fn iter(&self) -> <&'a [u8] as IntoIterator>::IntoIter { 170 + <&Self as IntoIterator>::into_iter(self) 171 + } 172 + } | warning: `IntoIterator` implemented for a reference type without an `iter_mut` method --> src/bytebuf.rs:176:1 | 176 | / impl<'a> IntoIterator for &'a mut ByteBuf { 177 | | type Item = &'a mut u8; 178 | | type IntoIter = <&'a mut [u8] as IntoIterator>::IntoIter; 179 | | ... | 182 | | } 183 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter help: consider implementing `iter_mut` | 176 + 177 + impl ByteBuf { 178 + fn iter_mut(&mut self) -> <&'a mut [u8] as IntoIterator>::IntoIter { 179 + <&mut Self as IntoIterator>::into_iter(self) 180 + } 181 + } | --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index fe6076f..dab41f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,6 +31,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] #![allow( + clippy::into_iter_without_iter, clippy::missing_errors_doc, clippy::must_use_candidate, clippy::needless_doctest_main