Skip to content

Commit

Permalink
Loosen the generic bound on impl IntoIterator for &SymbolTable
Browse files Browse the repository at this point in the history
All of these existing `IntoIterator` impls did not include the generic
parameter for the `BuildHasher`, meaning the impl was overly (and
unnecessarily) restrictive.

Found by `clippy::iter_without_into_iter`. See rust-lang/rust-clippy#11692 (comment).
  • Loading branch information
lopopolo committed Jan 3, 2024
1 parent 6a22a90 commit 6f8e2e4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl<'a> Iterator for Iter<'a> {

impl<'a> FusedIterator for Iter<'a> {}

impl<'a> IntoIterator for &'a SymbolTable {
impl<'a, S> IntoIterator for &'a SymbolTable<S> {
type Item = (Symbol, &'a [u8]);
type IntoIter = Iter<'a>;

Expand Down
2 changes: 1 addition & 1 deletion src/cstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> Iterator for Iter<'a> {

impl<'a> FusedIterator for Iter<'a> {}

impl<'a> IntoIterator for &'a SymbolTable {
impl<'a, S> IntoIterator for &'a SymbolTable<S> {
type Item = (Symbol, &'a CStr);
type IntoIter = Iter<'a>;

Expand Down
2 changes: 1 addition & 1 deletion src/osstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> Iterator for Iter<'a> {

impl<'a> FusedIterator for Iter<'a> {}

impl<'a> IntoIterator for &'a SymbolTable {
impl<'a, S> IntoIterator for &'a SymbolTable<S> {
type Item = (Symbol, &'a OsStr);
type IntoIter = Iter<'a>;

Expand Down
2 changes: 1 addition & 1 deletion src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> Iterator for Iter<'a> {

impl<'a> FusedIterator for Iter<'a> {}

impl<'a> IntoIterator for &'a SymbolTable {
impl<'a, S> IntoIterator for &'a SymbolTable<S> {
type Item = (Symbol, &'a Path);
type IntoIter = Iter<'a>;

Expand Down
2 changes: 1 addition & 1 deletion src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<'a> Iterator for Iter<'a> {

impl<'a> FusedIterator for Iter<'a> {}

impl<'a> IntoIterator for &'a SymbolTable {
impl<'a, S> IntoIterator for &'a SymbolTable<S> {
type Item = (Symbol, &'a str);
type IntoIter = Iter<'a>;

Expand Down

0 comments on commit 6f8e2e4

Please sign in to comment.