Skip to content

Commit

Permalink
Ignore into_iter_without_iter pedantic clippy lint
Browse files Browse the repository at this point in the history
    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 + }
        |
  • Loading branch information
dtolnay committed Oct 7, 2023
1 parent 6c699f2 commit deb9c32
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit deb9c32

Please sign in to comment.