Skip to content

Commit ae161ab

Browse files
committed
Ignore into_iter_without_iter clippy false positive
rust-lang/rust-clippy#11635 warning: `IntoIterator` implemented for a reference type without an `iter` method --> src/json/array.rs:72:1 | 72 | / impl<'a> IntoIterator for &'a Array { 73 | | type Item = &'a Value; 74 | | type IntoIter = <&'a Vec<Value> as IntoIterator>::IntoIter; 75 | | ... | 78 | | } 79 | | } | |_^ | = 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` | 72 + 73 + impl Array { 74 + fn iter(&self) -> <&'a Vec<Value> as IntoIterator>::IntoIter { 75 + <&Self as IntoIterator>::into_iter(self) 76 + } 77 + } | warning: `IntoIterator` implemented for a reference type without an `iter_mut` method --> src/json/array.rs:81:1 | 81 | / impl<'a> IntoIterator for &'a mut Array { 82 | | type Item = &'a mut Value; 83 | | type IntoIter = <&'a mut Vec<Value> as IntoIterator>::IntoIter; 84 | | ... | 87 | | } 88 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter help: consider implementing `iter_mut` | 81 + 82 + impl Array { 83 + fn iter_mut(&mut self) -> <&'a mut Vec<Value> as IntoIterator>::IntoIter { 84 + <&mut Self as IntoIterator>::into_iter(self) 85 + } 86 + } | warning: `IntoIterator` implemented for a reference type without an `iter` method --> src/json/object.rs:66:1 | 66 | / impl<'a> IntoIterator for &'a Object { 67 | | type Item = (&'a String, &'a Value); 68 | | type IntoIter = <&'a BTreeMap<String, Value> as IntoIterator>::IntoIter; 69 | | ... | 72 | | } 73 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter help: consider implementing `iter` | 66 + 67 + impl Object { 68 + fn iter(&self) -> <&'a BTreeMap<String, Value> as IntoIterator>::IntoIter { 69 + <&Self as IntoIterator>::into_iter(self) 70 + } 71 + } | warning: `IntoIterator` implemented for a reference type without an `iter_mut` method --> src/json/object.rs:75:1 | 75 | / impl<'a> IntoIterator for &'a mut Object { 76 | | type Item = (&'a String, &'a mut Value); 77 | | type IntoIter = <&'a mut BTreeMap<String, Value> as IntoIterator>::IntoIter; 78 | | ... | 81 | | } 82 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter help: consider implementing `iter_mut` | 75 + 76 + impl Object { 77 + fn iter_mut(&mut self) -> <&'a mut BTreeMap<String, Value> as IntoIterator>::IntoIter { 78 + <&mut Self as IntoIterator>::into_iter(self) 79 + } 80 + } |
1 parent 0dc535e commit ae161ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
clippy::checked_conversions,
142142
clippy::doc_markdown,
143143
clippy::enum_glob_use,
144+
clippy::into_iter_without_iter, // https://github.com/rust-lang/rust-clippy/issues/11635
144145
clippy::let_underscore_untyped,
145146
clippy::manual_range_contains,
146147
clippy::missing_errors_doc,

0 commit comments

Comments
 (0)