1 #![allow(dead_code, unused_variables, clippy::return_self_not_must_use)]
3 /// Utility macro to test linting behavior in `option_methods()`
4 /// The lints included in `option_methods()` should not lint if the call to map is partially
8 ($opt:expr, $map:expr) => {
13 /// Struct to generate false positive for Iterator-based lints
14 #[derive(Copy, Clone)]
15 pub struct IteratorFalsePositives {
19 impl IteratorFalsePositives {
20 pub fn filter(self) -> IteratorFalsePositives {
24 pub fn next(self) -> IteratorFalsePositives {
28 pub fn find(self) -> Option<u32> {
32 pub fn position(self) -> Option<u32> {
36 pub fn rposition(self) -> Option<u32> {
40 pub fn nth(self, n: usize) -> Option<u32> {
44 pub fn skip(self, _: usize) -> IteratorFalsePositives {
48 pub fn skip_while(self) -> IteratorFalsePositives {
52 pub fn count(self) -> usize {
57 #[derive(Copy, Clone)]
58 pub struct IteratorMethodFalsePositives;
60 impl IteratorMethodFalsePositives {
61 pub fn filter(&self, _s: i32) -> std::vec::IntoIter<i32> {