Skip to content

Conversation

@nham
Copy link
Contributor

@nham nham commented Jul 22, 2014

cc #15294

@nham
Copy link
Contributor Author

nham commented Jul 23, 2014

Not really. I was thinking that since we are deriving Hash automatically for TrieSet that if it works for TrieMap it will also work for TrieSet.

bors added a commit that referenced this pull request Jul 23, 2014
bors added a commit that referenced this pull request Jul 23, 2014
@bors bors closed this Jul 23, 2014
@bors bors merged commit 366c66e into rust-lang:master Jul 23, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2023
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 31, 2025
…-lang#15902)

Previously the program only fixed the code when the closure supplied to
the method contained only 1 line. This patch removes the restriction.

The code already works. This patch only removes the extra check that
causes the restriction. The test cases that can now be fixed are moved
into the files containing tests cases that can be fixed.

The unnecessary check has survived in the code this way.

- In Dec 2015, patch a6bd2d0, pull request
rust-lang/rust-clippy#524. The lint was first added. The program did not
support fixing code automatically yet. So the suggested fix was printed
as a part of the diagnostic message. When the original code contained
multiple lines, the suggested fix was omitted in order to keep the
diagnostic message concise.

- In May 2019, patch bd0b75f, pull request
rust-lang/rust-clippy#4049. Logic was added to strip the reference in
the closure when the suggested replacement method required it. Because
the fix was still only printed when the code contained a single line,
the new transformation was only done when the code contained a single
line.

- In Aug 2019, patch 945d4cf, pull request
rust-lang/rust-clippy#4454. The lint was updated to fix code
automatically. Because the fixed code had only been printed in the
diagnostic message for a single line, the fix was only added for a
single line.

- In Nov 2021, patch 092fe20, pull request
rust-lang/rust-clippy#7463. The logic for transforming the closure was
moved into another file. A comment was added saying that it was only
good for a single line because it had only been used for a single line.

changelog: [`search_is_some`] now fixes code spanning multiple lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants